From 9c4b0925d7b12350ea0aec43f323f5252693aaa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:26:52 +0000 Subject: [PATCH 01/18] Bump Submodule/github/rest-api-description from `ef4e98d` to `768a056` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `ef4e98d` to `768a056`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/ef4e98d7fcad5ec4476fd73b4d536557524f3c57...768a056f8e09a337a050da627073cc3c99ba1607) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: 768a056f8e09a337a050da627073cc3c99ba1607 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 ef4e98d7fc..768a056f8e 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit ef4e98d7fcad5ec4476fd73b4d536557524f3c57 +Subproject commit 768a056f8e09a337a050da627073cc3c99ba1607 From 281acf38a940d89e9a60fd0303bb9a20ae372398 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:33:37 +0000 Subject: [PATCH 02/18] Commit via running: make Sources/actions --- Sources/actions/Types.swift | 56 ++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 32ef448525..3c84249410 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -13104,6 +13104,34 @@ public enum Components { self.body = body } } + public struct Gone: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Gone.Body + /// Creates a new `Gone`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Gone.Body) { + self.body = body + } + } public struct InternalError: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/internal_error/content`. @frozen public enum Body: Sendable, Hashable { @@ -13315,34 +13343,6 @@ public enum Components { self.body = body } } - public struct Gone: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.Gone.Body - /// Creates a new `Gone`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Gone.Body) { - self.body = body - } - } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers { From 40b35f3c4012a61dba185a41f5eac9d93e491930 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:34:23 +0000 Subject: [PATCH 03/18] Commit via running: make Sources/apps --- Sources/apps/Types.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index d5c98d6293..a5a8b33601 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -2236,7 +2236,7 @@ public enum Components { case createdAt = "created_at" } } - /// The permissions granted to the user access token. + /// The permissions granted to the fine-grained access token. /// /// - Remark: Generated from `#/components/schemas/app-permissions`. public struct AppPermissions: Codable, Hashable, Sendable { From be7cfa319324e12304ba18a7ceb1fb2b3b524ef3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:34:46 +0000 Subject: [PATCH 04/18] Commit via running: make Sources/billing --- Sources/billing/Types.swift | 47 ++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index ab09082915..ff885f7e61 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -870,6 +870,7 @@ public enum Components { case repository = "repository" case costCenter = "cost_center" case multiUserCustomer = "multi_user_customer" + case multiUserCostCenter = "multi_user_cost_center" case user = "user" } /// The scope of the budget @@ -1071,6 +1072,7 @@ public enum Components { case repository = "repository" case costCenter = "cost_center" case multiUserCustomer = "multi_user_customer" + case multiUserCostCenter = "multi_user_cost_center" case user = "user" } /// The type of scope for the budget @@ -1246,6 +1248,7 @@ public enum Components { case repository = "repository" case costCenter = "cost_center" case multiUserCustomer = "multi_user_customer" + case multiUserCostCenter = "multi_user_cost_center" case user = "user" } /// The type of scope for the budget @@ -1416,6 +1419,7 @@ public enum Components { case repository = "repository" case costCenter = "cost_center" case multiUserCustomer = "multi_user_customer" + case multiUserCostCenter = "multi_user_cost_center" case user = "user" } /// The type of scope for the budget @@ -3714,6 +3718,11 @@ public enum Operations { } /// Filter budgets by scope type. /// + /// - `organization`: Budgets scoped to the organization. + /// - `repository`: Budgets scoped to a repository. + /// - `multi_user_customer`: Universal budgets that apply to all users in the organization. + /// - `user`: Budgets scoped to an individual user. + /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/GET/query/scope`. public var scope: Operations.BillingGetAllBudgetsOrg.Input.Query.ScopePayload? /// Filter consumed amount details for budgets by the specified user login. @@ -3970,7 +3979,15 @@ public enum Operations { } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_alerting`. public var budgetAlerting: Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetAlertingPayload? - /// The scope of the budget for this organization. Use 'organization' for org-level budgets or 'repository' for repo-specific budgets within the organization. `user` and `multi_user_customer` scopes are only supported when `budget_product_sku` is `ai_credits` or `premium_requests`. + /// The scope of the budget for this organization. + /// + /// - `organization`: Apply the budget to the organization. + /// - `repository`: Apply the budget to a specific repository in the organization. + /// - `multi_user_customer`: Apply a universal budget to all users in the organization. + /// - `user`: Apply the budget to a single user in the organization. + /// + /// `user` and `multi_user_customer` scopes are only supported when + /// `budget_product_sku` is `ai_credits` or `premium_requests`. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_scope`. @frozen public enum BudgetScopePayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -3979,7 +3996,15 @@ public enum Operations { case multiUserCustomer = "multi_user_customer" case user = "user" } - /// The scope of the budget for this organization. Use 'organization' for org-level budgets or 'repository' for repo-specific budgets within the organization. `user` and `multi_user_customer` scopes are only supported when `budget_product_sku` is `ai_credits` or `premium_requests`. + /// The scope of the budget for this organization. + /// + /// - `organization`: Apply the budget to the organization. + /// - `repository`: Apply the budget to a specific repository in the organization. + /// - `multi_user_customer`: Apply a universal budget to all users in the organization. + /// - `user`: Apply the budget to a single user in the organization. + /// + /// `user` and `multi_user_customer` scopes are only supported when + /// `budget_product_sku` is `ai_credits` or `premium_requests`. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_scope`. public var budgetScope: Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetScopePayload? @@ -4072,7 +4097,7 @@ public enum Operations { /// - budgetAmount: The budget amount in whole dollars. For license-based products, this represents the number of licenses. /// - preventFurtherUsage: Whether to prevent additional spending once the budget is exceeded. For `user` and `multi_user_customer` scopes, this must be `true`. /// - budgetAlerting: - /// - budgetScope: The scope of the budget for this organization. Use 'organization' for org-level budgets or 'repository' for repo-specific budgets within the organization. `user` and `multi_user_customer` scopes are only supported when `budget_product_sku` is `ai_credits` or `premium_requests`. + /// - budgetScope: The scope of the budget for this organization. /// - budgetEntityName: The name of the entity to apply the budget to /// - budgetType: The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. /// - budgetProductSku: A single product or SKU that will be covered in the budget @@ -4758,7 +4783,12 @@ public enum Operations { } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_alerting`. public var budgetAlerting: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetAlertingPayload? - /// The scope of the budget + /// The scope of the budget for this organization. + /// + /// - `organization`: Apply the budget to the organization. + /// - `repository`: Apply the budget to a specific repository in the organization. + /// - `multi_user_customer`: Apply a universal budget to all users in the organization. + /// - `user`: Apply the budget to a single user in the organization. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_scope`. @frozen public enum BudgetScopePayload: String, Codable, Hashable, Sendable, CaseIterable { @@ -4769,7 +4799,12 @@ public enum Operations { case multiUserCustomer = "multi_user_customer" case user = "user" } - /// The scope of the budget + /// The scope of the budget for this organization. + /// + /// - `organization`: Apply the budget to the organization. + /// - `repository`: Apply the budget to a specific repository in the organization. + /// - `multi_user_customer`: Apply a universal budget to all users in the organization. + /// - `user`: Apply the budget to a single user in the organization. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_scope`. public var budgetScope: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetScopePayload? @@ -4862,7 +4897,7 @@ public enum Operations { /// - budgetAmount: The budget amount in whole dollars. For license-based products, this represents the number of licenses. /// - preventFurtherUsage: Whether to prevent additional spending once the budget is exceeded. For budgets with `user` or `multi_user_customer` scope, this must remain `true`. /// - budgetAlerting: - /// - budgetScope: The scope of the budget + /// - budgetScope: The scope of the budget for this organization. /// - budgetEntityName: The name of the entity to apply the budget to /// - budgetType: The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. /// - budgetProductSku: A single product or SKU that will be covered in the budget From 0bbdac9ec6a47e8297a9c0b3e44813f5d64dc368 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:35:32 +0000 Subject: [PATCH 05/18] Commit via running: make Sources/code-scanning --- Sources/code-scanning/Client.swift | 16 +- Sources/code-scanning/Types.swift | 1976 +++++++++++++++++++++++++++- 2 files changed, 1957 insertions(+), 35 deletions(-) diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index a180d0efdc..8ead7d3fd7 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -896,9 +896,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 503: + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -908,7 +908,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -917,7 +917,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .internalServerError(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1080,9 +1080,9 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 422: return .unprocessableContent(.init()) - case 503: + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1092,7 +1092,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1101,7 +1101,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .internalServerError(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index 411542c8d5..c1cd73a3aa 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -1260,6 +1260,851 @@ public enum Components { case userViewType = "user_view_type" } } + /// License Simple + /// + /// - Remark: Generated from `#/components/schemas/nullable-license-simple`. + public struct NullableLicenseSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/key`. + public var key: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/spdx_id`. + public var spdxId: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-license-simple/html_url`. + public var htmlUrl: Swift.String? + /// Creates a new `NullableLicenseSimple`. + /// + /// - Parameters: + /// - key: + /// - name: + /// - url: + /// - spdxId: + /// - nodeId: + /// - htmlUrl: + public init( + key: Swift.String, + name: Swift.String, + url: Swift.String? = nil, + spdxId: Swift.String? = nil, + nodeId: Swift.String, + htmlUrl: Swift.String? = nil + ) { + self.key = key + self.name = name + self.url = url + self.spdxId = spdxId + self.nodeId = nodeId + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case key + case name + case url + case spdxId = "spdx_id" + case nodeId = "node_id" + case htmlUrl = "html_url" + } + } + /// A repository on GitHub. + /// + /// - Remark: Generated from `#/components/schemas/repository`. + public struct Repository: Codable, Hashable, Sendable { + /// Unique identifier of the repository + /// + /// - Remark: Generated from `#/components/schemas/repository/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/repository/node_id`. + public var nodeId: Swift.String + /// The name of the repository. + /// + /// - Remark: Generated from `#/components/schemas/repository/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/full_name`. + public var fullName: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/license`. + public var license: Components.Schemas.NullableLicenseSimple? + /// - Remark: Generated from `#/components/schemas/repository/forks`. + public var forks: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/permissions/admin`. + public var admin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/triage`. + public var triage: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/permissions/maintain`. + public var maintain: Swift.Bool? + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - admin: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + public init( + admin: Swift.Bool, + pull: Swift.Bool, + triage: Swift.Bool? = nil, + push: Swift.Bool, + maintain: Swift.Bool? = nil + ) { + self.admin = admin + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + } + public enum CodingKeys: String, CodingKey { + case admin + case pull + case triage + case push + case maintain + } + } + /// - Remark: Generated from `#/components/schemas/repository/permissions`. + public var permissions: Components.Schemas.Repository.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/repository/owner`. + public var owner: Components.Schemas.SimpleUser + /// Whether the repository is private or public. + /// + /// - Remark: Generated from `#/components/schemas/repository/private`. + public var _private: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/fork`. + public var fork: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/archive_url`. + public var archiveUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/assignees_url`. + public var assigneesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/blobs_url`. + public var blobsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/branches_url`. + public var branchesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/collaborators_url`. + public var collaboratorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/compare_url`. + public var compareUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/contents_url`. + public var contentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/contributors_url`. + public var contributorsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/deployments_url`. + public var deploymentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/downloads_url`. + public var downloadsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/forks_url`. + public var forksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_commits_url`. + public var gitCommitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_refs_url`. + public var gitRefsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_tags_url`. + public var gitTagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/git_url`. + public var gitUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issue_comment_url`. + public var issueCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issue_events_url`. + public var issueEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/issues_url`. + public var issuesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/keys_url`. + public var keysUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/languages_url`. + public var languagesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/merges_url`. + public var mergesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/milestones_url`. + public var milestonesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/notifications_url`. + public var notificationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/pulls_url`. + public var pullsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/releases_url`. + public var releasesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/ssh_url`. + public var sshUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/stargazers_url`. + public var stargazersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/subscribers_url`. + public var subscribersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/subscription_url`. + public var subscriptionUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/tags_url`. + public var tagsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/teams_url`. + public var teamsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/trees_url`. + public var treesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/clone_url`. + public var cloneUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/mirror_url`. + public var mirrorUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/hooks_url`. + public var hooksUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/svn_url`. + public var svnUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/homepage`. + public var homepage: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/language`. + public var language: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/forks_count`. + public var forksCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/stargazers_count`. + public var stargazersCount: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/watchers_count`. + public var watchersCount: Swift.Int + /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// + /// - Remark: Generated from `#/components/schemas/repository/size`. + public var size: Swift.Int + /// The default branch of the repository. + /// + /// - Remark: Generated from `#/components/schemas/repository/default_branch`. + public var defaultBranch: Swift.String + /// - Remark: Generated from `#/components/schemas/repository/open_issues_count`. + public var openIssuesCount: Swift.Int + /// Whether this repository acts as a template that can be used to generate new repositories. + /// + /// - Remark: Generated from `#/components/schemas/repository/is_template`. + public var isTemplate: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/topics`. + public var topics: [Swift.String]? + /// Whether issues are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_issues`. + public var hasIssues: Swift.Bool + /// Whether projects are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_projects`. + public var hasProjects: Swift.Bool + /// Whether the wiki is enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_wiki`. + public var hasWiki: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository/has_pages`. + public var hasPages: Swift.Bool + /// Whether downloads are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_downloads`. + @available(*, deprecated) + public var hasDownloads: Swift.Bool + /// Whether discussions are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_discussions`. + public var hasDiscussions: Swift.Bool? + /// Whether pull requests are enabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/has_pull_requests`. + public var hasPullRequests: Swift.Bool? + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + @frozen public enum PullRequestCreationPolicyPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case collaboratorsOnly = "collaborators_only" + } + /// The policy controlling who can create pull requests: all or collaborators_only. + /// + /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. + public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? + /// Whether the repository is archived. + /// + /// - Remark: Generated from `#/components/schemas/repository/archived`. + public var archived: Swift.Bool + /// Returns whether or not this repository disabled. + /// + /// - Remark: Generated from `#/components/schemas/repository/disabled`. + public var disabled: Swift.Bool + /// The repository visibility: public, private, or internal. + /// + /// - Remark: Generated from `#/components/schemas/repository/visibility`. + public var visibility: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/pushed_at`. + public var pushedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/repository/created_at`. + public var createdAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/repository/updated_at`. + public var updatedAt: Foundation.Date? + /// Whether to allow rebase merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_rebase_merge`. + public var allowRebaseMerge: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/temp_clone_token`. + public var tempCloneToken: Swift.String? + /// Whether to allow squash merges for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_squash_merge`. + public var allowSquashMerge: Swift.Bool? + /// Whether to allow Auto-merge to be used on pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_auto_merge`. + public var allowAutoMerge: Swift.Bool? + /// Whether to delete head branches when pull requests are merged + /// + /// - Remark: Generated from `#/components/schemas/repository/delete_branch_on_merge`. + public var deleteBranchOnMerge: Swift.Bool? + /// Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_update_branch`. + public var allowUpdateBranch: Swift.Bool? + /// Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// + /// - Remark: Generated from `#/components/schemas/repository/use_squash_pr_title_as_default`. + @available(*, deprecated) + public var useSquashPrTitleAsDefault: Swift.Bool? + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_title`. + @frozen public enum SquashMergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case commitOrPrTitle = "COMMIT_OR_PR_TITLE" + } + /// The default value for a squash merge commit title: + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_title`. + public var squashMergeCommitTitle: Components.Schemas.Repository.SquashMergeCommitTitlePayload? + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_message`. + @frozen public enum SquashMergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case commitMessages = "COMMIT_MESSAGES" + case blank = "BLANK" + } + /// The default value for a squash merge commit message: + /// + /// - `PR_BODY` - default to the pull request's body. + /// - `COMMIT_MESSAGES` - default to the branch's commit messages. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/squash_merge_commit_message`. + public var squashMergeCommitMessage: Components.Schemas.Repository.SquashMergeCommitMessagePayload? + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_title`. + @frozen public enum MergeCommitTitlePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prTitle = "PR_TITLE" + case mergeMessage = "MERGE_MESSAGE" + } + /// The default value for a merge commit title. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_title`. + public var mergeCommitTitle: Components.Schemas.Repository.MergeCommitTitlePayload? + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_message`. + @frozen public enum MergeCommitMessagePayload: String, Codable, Hashable, Sendable, CaseIterable { + case prBody = "PR_BODY" + case prTitle = "PR_TITLE" + case blank = "BLANK" + } + /// The default value for a merge commit message. + /// + /// - `PR_TITLE` - default to the pull request's title. + /// - `PR_BODY` - default to the pull request's body. + /// - `BLANK` - default to a blank commit message. + /// + /// - Remark: Generated from `#/components/schemas/repository/merge_commit_message`. + public var mergeCommitMessage: Components.Schemas.Repository.MergeCommitMessagePayload? + /// Whether to allow merge commits for pull requests. + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_merge_commit`. + public var allowMergeCommit: Swift.Bool? + /// Whether to allow forking this repo + /// + /// - Remark: Generated from `#/components/schemas/repository/allow_forking`. + public var allowForking: Swift.Bool? + /// Whether to require contributors to sign off on web-based commits + /// + /// - Remark: Generated from `#/components/schemas/repository/web_commit_signoff_required`. + public var webCommitSignoffRequired: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/watchers`. + public var watchers: Swift.Int + /// - Remark: Generated from `#/components/schemas/repository/master_branch`. + public var masterBranch: Swift.String? + /// - Remark: Generated from `#/components/schemas/repository/starred_at`. + public var starredAt: Swift.String? + /// Whether anonymous git access is enabled for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/anonymous_access_enabled`. + public var anonymousAccessEnabled: Swift.Bool? + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public struct CodeSearchIndexStatusPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_search_ok`. + public var lexicalSearchOk: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status/lexical_commit_sha`. + public var lexicalCommitSha: Swift.String? + /// Creates a new `CodeSearchIndexStatusPayload`. + /// + /// - Parameters: + /// - lexicalSearchOk: + /// - lexicalCommitSha: + public init( + lexicalSearchOk: Swift.Bool? = nil, + lexicalCommitSha: Swift.String? = nil + ) { + self.lexicalSearchOk = lexicalSearchOk + self.lexicalCommitSha = lexicalCommitSha + } + public enum CodingKeys: String, CodingKey { + case lexicalSearchOk = "lexical_search_ok" + case lexicalCommitSha = "lexical_commit_sha" + } + } + /// The status of the code search index for this repository + /// + /// - Remark: Generated from `#/components/schemas/repository/code_search_index_status`. + public var codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? + /// Creates a new `Repository`. + /// + /// - Parameters: + /// - id: Unique identifier of the repository + /// - nodeId: + /// - name: The name of the repository. + /// - fullName: + /// - license: + /// - forks: + /// - permissions: + /// - owner: + /// - _private: Whether the repository is private or public. + /// - htmlUrl: + /// - description: + /// - fork: + /// - url: + /// - archiveUrl: + /// - assigneesUrl: + /// - blobsUrl: + /// - branchesUrl: + /// - collaboratorsUrl: + /// - commentsUrl: + /// - commitsUrl: + /// - compareUrl: + /// - contentsUrl: + /// - contributorsUrl: + /// - deploymentsUrl: + /// - downloadsUrl: + /// - eventsUrl: + /// - forksUrl: + /// - gitCommitsUrl: + /// - gitRefsUrl: + /// - gitTagsUrl: + /// - gitUrl: + /// - issueCommentUrl: + /// - issueEventsUrl: + /// - issuesUrl: + /// - keysUrl: + /// - labelsUrl: + /// - languagesUrl: + /// - mergesUrl: + /// - milestonesUrl: + /// - notificationsUrl: + /// - pullsUrl: + /// - releasesUrl: + /// - sshUrl: + /// - stargazersUrl: + /// - statusesUrl: + /// - subscribersUrl: + /// - subscriptionUrl: + /// - tagsUrl: + /// - teamsUrl: + /// - treesUrl: + /// - cloneUrl: + /// - mirrorUrl: + /// - hooksUrl: + /// - svnUrl: + /// - homepage: + /// - language: + /// - forksCount: + /// - stargazersCount: + /// - watchersCount: + /// - size: The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + /// - defaultBranch: The default branch of the repository. + /// - openIssuesCount: + /// - isTemplate: Whether this repository acts as a template that can be used to generate new repositories. + /// - topics: + /// - hasIssues: Whether issues are enabled. + /// - hasProjects: Whether projects are enabled. + /// - hasWiki: Whether the wiki is enabled. + /// - hasPages: + /// - hasDownloads: Whether downloads are enabled. + /// - hasDiscussions: Whether discussions are enabled. + /// - hasPullRequests: Whether pull requests are enabled. + /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. + /// - archived: Whether the repository is archived. + /// - disabled: Returns whether or not this repository disabled. + /// - visibility: The repository visibility: public, private, or internal. + /// - pushedAt: + /// - createdAt: + /// - updatedAt: + /// - allowRebaseMerge: Whether to allow rebase merges for pull requests. + /// - tempCloneToken: + /// - allowSquashMerge: Whether to allow squash merges for pull requests. + /// - allowAutoMerge: Whether to allow Auto-merge to be used on pull requests. + /// - deleteBranchOnMerge: Whether to delete head branches when pull requests are merged + /// - allowUpdateBranch: Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + /// - useSquashPrTitleAsDefault: Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. + /// - squashMergeCommitTitle: The default value for a squash merge commit title: + /// - squashMergeCommitMessage: The default value for a squash merge commit message: + /// - mergeCommitTitle: The default value for a merge commit title. + /// - mergeCommitMessage: The default value for a merge commit message. + /// - allowMergeCommit: Whether to allow merge commits for pull requests. + /// - allowForking: Whether to allow forking this repo + /// - webCommitSignoffRequired: Whether to require contributors to sign off on web-based commits + /// - openIssues: + /// - watchers: + /// - masterBranch: + /// - starredAt: + /// - anonymousAccessEnabled: Whether anonymous git access is enabled for this repository + /// - codeSearchIndexStatus: The status of the code search index for this repository + public init( + id: Swift.Int64, + nodeId: Swift.String, + name: Swift.String, + fullName: Swift.String, + license: Components.Schemas.NullableLicenseSimple? = nil, + forks: Swift.Int, + permissions: Components.Schemas.Repository.PermissionsPayload? = nil, + owner: Components.Schemas.SimpleUser, + _private: Swift.Bool, + htmlUrl: Swift.String, + description: Swift.String? = nil, + fork: Swift.Bool, + url: Swift.String, + archiveUrl: Swift.String, + assigneesUrl: Swift.String, + blobsUrl: Swift.String, + branchesUrl: Swift.String, + collaboratorsUrl: Swift.String, + commentsUrl: Swift.String, + commitsUrl: Swift.String, + compareUrl: Swift.String, + contentsUrl: Swift.String, + contributorsUrl: Swift.String, + deploymentsUrl: Swift.String, + downloadsUrl: Swift.String, + eventsUrl: Swift.String, + forksUrl: Swift.String, + gitCommitsUrl: Swift.String, + gitRefsUrl: Swift.String, + gitTagsUrl: Swift.String, + gitUrl: Swift.String, + issueCommentUrl: Swift.String, + issueEventsUrl: Swift.String, + issuesUrl: Swift.String, + keysUrl: Swift.String, + labelsUrl: Swift.String, + languagesUrl: Swift.String, + mergesUrl: Swift.String, + milestonesUrl: Swift.String, + notificationsUrl: Swift.String, + pullsUrl: Swift.String, + releasesUrl: Swift.String, + sshUrl: Swift.String, + stargazersUrl: Swift.String, + statusesUrl: Swift.String, + subscribersUrl: Swift.String, + subscriptionUrl: Swift.String, + tagsUrl: Swift.String, + teamsUrl: Swift.String, + treesUrl: Swift.String, + cloneUrl: Swift.String, + mirrorUrl: Swift.String? = nil, + hooksUrl: Swift.String, + svnUrl: Swift.String, + homepage: Swift.String? = nil, + language: Swift.String? = nil, + forksCount: Swift.Int, + stargazersCount: Swift.Int, + watchersCount: Swift.Int, + size: Swift.Int, + defaultBranch: Swift.String, + openIssuesCount: Swift.Int, + isTemplate: Swift.Bool? = nil, + topics: [Swift.String]? = nil, + hasIssues: Swift.Bool, + hasProjects: Swift.Bool, + hasWiki: Swift.Bool, + hasPages: Swift.Bool, + hasDownloads: Swift.Bool, + hasDiscussions: Swift.Bool? = nil, + hasPullRequests: Swift.Bool? = nil, + pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, + archived: Swift.Bool, + disabled: Swift.Bool, + visibility: Swift.String? = nil, + pushedAt: Foundation.Date? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + allowRebaseMerge: Swift.Bool? = nil, + tempCloneToken: Swift.String? = nil, + allowSquashMerge: Swift.Bool? = nil, + allowAutoMerge: Swift.Bool? = nil, + deleteBranchOnMerge: Swift.Bool? = nil, + allowUpdateBranch: Swift.Bool? = nil, + useSquashPrTitleAsDefault: Swift.Bool? = nil, + squashMergeCommitTitle: Components.Schemas.Repository.SquashMergeCommitTitlePayload? = nil, + squashMergeCommitMessage: Components.Schemas.Repository.SquashMergeCommitMessagePayload? = nil, + mergeCommitTitle: Components.Schemas.Repository.MergeCommitTitlePayload? = nil, + mergeCommitMessage: Components.Schemas.Repository.MergeCommitMessagePayload? = nil, + allowMergeCommit: Swift.Bool? = nil, + allowForking: Swift.Bool? = nil, + webCommitSignoffRequired: Swift.Bool? = nil, + openIssues: Swift.Int, + watchers: Swift.Int, + masterBranch: Swift.String? = nil, + starredAt: Swift.String? = nil, + anonymousAccessEnabled: Swift.Bool? = nil, + codeSearchIndexStatus: Components.Schemas.Repository.CodeSearchIndexStatusPayload? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.fullName = fullName + self.license = license + self.forks = forks + self.permissions = permissions + self.owner = owner + self._private = _private + self.htmlUrl = htmlUrl + self.description = description + self.fork = fork + self.url = url + self.archiveUrl = archiveUrl + self.assigneesUrl = assigneesUrl + self.blobsUrl = blobsUrl + self.branchesUrl = branchesUrl + self.collaboratorsUrl = collaboratorsUrl + self.commentsUrl = commentsUrl + self.commitsUrl = commitsUrl + self.compareUrl = compareUrl + self.contentsUrl = contentsUrl + self.contributorsUrl = contributorsUrl + self.deploymentsUrl = deploymentsUrl + self.downloadsUrl = downloadsUrl + self.eventsUrl = eventsUrl + self.forksUrl = forksUrl + self.gitCommitsUrl = gitCommitsUrl + self.gitRefsUrl = gitRefsUrl + self.gitTagsUrl = gitTagsUrl + self.gitUrl = gitUrl + self.issueCommentUrl = issueCommentUrl + self.issueEventsUrl = issueEventsUrl + self.issuesUrl = issuesUrl + self.keysUrl = keysUrl + self.labelsUrl = labelsUrl + self.languagesUrl = languagesUrl + self.mergesUrl = mergesUrl + self.milestonesUrl = milestonesUrl + self.notificationsUrl = notificationsUrl + self.pullsUrl = pullsUrl + self.releasesUrl = releasesUrl + self.sshUrl = sshUrl + self.stargazersUrl = stargazersUrl + self.statusesUrl = statusesUrl + self.subscribersUrl = subscribersUrl + self.subscriptionUrl = subscriptionUrl + self.tagsUrl = tagsUrl + self.teamsUrl = teamsUrl + self.treesUrl = treesUrl + self.cloneUrl = cloneUrl + self.mirrorUrl = mirrorUrl + self.hooksUrl = hooksUrl + self.svnUrl = svnUrl + self.homepage = homepage + self.language = language + self.forksCount = forksCount + self.stargazersCount = stargazersCount + self.watchersCount = watchersCount + self.size = size + self.defaultBranch = defaultBranch + self.openIssuesCount = openIssuesCount + self.isTemplate = isTemplate + self.topics = topics + self.hasIssues = hasIssues + self.hasProjects = hasProjects + self.hasWiki = hasWiki + self.hasPages = hasPages + self.hasDownloads = hasDownloads + self.hasDiscussions = hasDiscussions + self.hasPullRequests = hasPullRequests + self.pullRequestCreationPolicy = pullRequestCreationPolicy + self.archived = archived + self.disabled = disabled + self.visibility = visibility + self.pushedAt = pushedAt + self.createdAt = createdAt + self.updatedAt = updatedAt + self.allowRebaseMerge = allowRebaseMerge + self.tempCloneToken = tempCloneToken + self.allowSquashMerge = allowSquashMerge + self.allowAutoMerge = allowAutoMerge + self.deleteBranchOnMerge = deleteBranchOnMerge + self.allowUpdateBranch = allowUpdateBranch + self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault + self.squashMergeCommitTitle = squashMergeCommitTitle + self.squashMergeCommitMessage = squashMergeCommitMessage + self.mergeCommitTitle = mergeCommitTitle + self.mergeCommitMessage = mergeCommitMessage + self.allowMergeCommit = allowMergeCommit + self.allowForking = allowForking + self.webCommitSignoffRequired = webCommitSignoffRequired + self.openIssues = openIssues + self.watchers = watchers + self.masterBranch = masterBranch + self.starredAt = starredAt + self.anonymousAccessEnabled = anonymousAccessEnabled + self.codeSearchIndexStatus = codeSearchIndexStatus + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case fullName = "full_name" + case license + case forks + case permissions + case owner + case _private = "private" + case htmlUrl = "html_url" + case description + case fork + case url + case archiveUrl = "archive_url" + case assigneesUrl = "assignees_url" + case blobsUrl = "blobs_url" + case branchesUrl = "branches_url" + case collaboratorsUrl = "collaborators_url" + case commentsUrl = "comments_url" + case commitsUrl = "commits_url" + case compareUrl = "compare_url" + case contentsUrl = "contents_url" + case contributorsUrl = "contributors_url" + case deploymentsUrl = "deployments_url" + case downloadsUrl = "downloads_url" + case eventsUrl = "events_url" + case forksUrl = "forks_url" + case gitCommitsUrl = "git_commits_url" + case gitRefsUrl = "git_refs_url" + case gitTagsUrl = "git_tags_url" + case gitUrl = "git_url" + case issueCommentUrl = "issue_comment_url" + case issueEventsUrl = "issue_events_url" + case issuesUrl = "issues_url" + case keysUrl = "keys_url" + case labelsUrl = "labels_url" + case languagesUrl = "languages_url" + case mergesUrl = "merges_url" + case milestonesUrl = "milestones_url" + case notificationsUrl = "notifications_url" + case pullsUrl = "pulls_url" + case releasesUrl = "releases_url" + case sshUrl = "ssh_url" + case stargazersUrl = "stargazers_url" + case statusesUrl = "statuses_url" + case subscribersUrl = "subscribers_url" + case subscriptionUrl = "subscription_url" + case tagsUrl = "tags_url" + case teamsUrl = "teams_url" + case treesUrl = "trees_url" + case cloneUrl = "clone_url" + case mirrorUrl = "mirror_url" + case hooksUrl = "hooks_url" + case svnUrl = "svn_url" + case homepage + case language + case forksCount = "forks_count" + case stargazersCount = "stargazers_count" + case watchersCount = "watchers_count" + case size + case defaultBranch = "default_branch" + case openIssuesCount = "open_issues_count" + case isTemplate = "is_template" + case topics + case hasIssues = "has_issues" + case hasProjects = "has_projects" + case hasWiki = "has_wiki" + case hasPages = "has_pages" + case hasDownloads = "has_downloads" + case hasDiscussions = "has_discussions" + case hasPullRequests = "has_pull_requests" + case pullRequestCreationPolicy = "pull_request_creation_policy" + case archived + case disabled + case visibility + case pushedAt = "pushed_at" + case createdAt = "created_at" + case updatedAt = "updated_at" + case allowRebaseMerge = "allow_rebase_merge" + case tempCloneToken = "temp_clone_token" + case allowSquashMerge = "allow_squash_merge" + case allowAutoMerge = "allow_auto_merge" + case deleteBranchOnMerge = "delete_branch_on_merge" + case allowUpdateBranch = "allow_update_branch" + case useSquashPrTitleAsDefault = "use_squash_pr_title_as_default" + case squashMergeCommitTitle = "squash_merge_commit_title" + case squashMergeCommitMessage = "squash_merge_commit_message" + case mergeCommitTitle = "merge_commit_title" + case mergeCommitMessage = "merge_commit_message" + case allowMergeCommit = "allow_merge_commit" + case allowForking = "allow_forking" + case webCommitSignoffRequired = "web_commit_signoff_required" + case openIssues = "open_issues" + case watchers + case masterBranch = "master_branch" + case starredAt = "starred_at" + case anonymousAccessEnabled = "anonymous_access_enabled" + case codeSearchIndexStatus = "code_search_index_status" + } + } /// A GitHub repository. /// /// - Remark: Generated from `#/components/schemas/simple-repository`. @@ -1667,14 +2512,476 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/alert-fixed-at`. public typealias AlertFixedAt = Foundation.Date + /// A collection of related issues and pull requests. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone`. + public struct NullableMilestone: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-milestone/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/node_id`. + public var nodeId: Swift.String + /// The number of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/number`. + public var number: Swift.Int + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// The state of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/state`. + public var state: Components.Schemas.NullableMilestone.StatePayload + /// The title of the milestone. + /// + /// - Remark: Generated from `#/components/schemas/nullable-milestone/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-milestone/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/creator`. + public var creator: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_issues`. + public var closedIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-milestone/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/nullable-milestone/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/nullable-milestone/due_on`. + public var dueOn: Foundation.Date? + /// Creates a new `NullableMilestone`. + /// + /// - Parameters: + /// - url: + /// - htmlUrl: + /// - labelsUrl: + /// - id: + /// - nodeId: + /// - number: The number of the milestone. + /// - state: The state of the milestone. + /// - title: The title of the milestone. + /// - description: + /// - creator: + /// - openIssues: + /// - closedIssues: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - dueOn: + public init( + url: Swift.String, + htmlUrl: Swift.String, + labelsUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + number: Swift.Int, + state: Components.Schemas.NullableMilestone.StatePayload, + title: Swift.String, + description: Swift.String? = nil, + creator: Components.Schemas.NullableSimpleUser? = nil, + openIssues: Swift.Int, + closedIssues: Swift.Int, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + dueOn: Foundation.Date? = nil + ) { + self.url = url + self.htmlUrl = htmlUrl + self.labelsUrl = labelsUrl + self.id = id + self.nodeId = nodeId + self.number = number + self.state = state + self.title = title + self.description = description + self.creator = creator + self.openIssues = openIssues + self.closedIssues = closedIssues + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.dueOn = dueOn + } + public enum CodingKeys: String, CodingKey { + case url + case htmlUrl = "html_url" + case labelsUrl = "labels_url" + case id + case nodeId = "node_id" + case number + case state + case title + case description + case creator + case openIssues = "open_issues" + case closedIssues = "closed_issues" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case dueOn = "due_on" + } + } + /// How the author is associated with the repository. + /// + /// - Remark: Generated from `#/components/schemas/author-association`. + @frozen public enum AuthorAssociation: String, Codable, Hashable, Sendable, CaseIterable { + case collaborator = "COLLABORATOR" + case contributor = "CONTRIBUTOR" + case firstTimer = "FIRST_TIMER" + case firstTimeContributor = "FIRST_TIME_CONTRIBUTOR" + case mannequin = "MANNEQUIN" + case member = "MEMBER" + case none = "NONE" + case owner = "OWNER" + } /// An object without any properties. /// - /// - Remark: Generated from `#/components/schemas/empty-object`. - public struct EmptyObject: Codable, Hashable, Sendable { - /// Creates a new `EmptyObject`. - public init() {} - public init(from decoder: any Swift.Decoder) throws { - try decoder.ensureNoAdditionalProperties(knownKeys: []) + /// - Remark: Generated from `#/components/schemas/empty-object`. + public struct EmptyObject: Codable, Hashable, Sendable { + /// Creates a new `EmptyObject`. + public init() {} + public init(from decoder: any Swift.Decoder) throws { + try decoder.ensureNoAdditionalProperties(knownKeys: []) + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple`. + public struct NullableTeamSimple: Codable, Hashable, Sendable { + /// Unique identifier of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`. + public var nodeId: Swift.String + /// URL for the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`. + public var membersUrl: Swift.String + /// Name of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`. + public var name: Swift.String + /// Description of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`. + public var description: Swift.String? + /// Permission that the team will have for its repositories + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`. + public var permission: Swift.String + /// The level of privacy this team should have + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`. + public var privacy: Swift.String? + /// The notification setting the team has set + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`. + public var repositoriesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`. + public var slug: Swift.String + /// Distinguished Name (DN) that team maps to within LDAP environment + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`. + public var ldapDn: Swift.String? + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`. + public var _type: Components.Schemas.NullableTeamSimple._TypePayload + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`. + public var enterpriseId: Swift.Int? + /// Creates a new `NullableTeamSimple`. + /// + /// - Parameters: + /// - id: Unique identifier of the team + /// - nodeId: + /// - url: URL for the team + /// - membersUrl: + /// - name: Name of the team + /// - description: Description of the team + /// - permission: Permission that the team will have for its repositories + /// - privacy: The level of privacy this team should have + /// - notificationSetting: The notification setting the team has set + /// - htmlUrl: + /// - repositoriesUrl: + /// - slug: + /// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment + /// - _type: The ownership type of the team + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + membersUrl: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + permission: Swift.String, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + htmlUrl: Swift.String, + repositoriesUrl: Swift.String, + slug: Swift.String, + ldapDn: Swift.String? = nil, + _type: Components.Schemas.NullableTeamSimple._TypePayload, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.membersUrl = membersUrl + self.name = name + self.description = description + self.permission = permission + self.privacy = privacy + self.notificationSetting = notificationSetting + self.htmlUrl = htmlUrl + self.repositoriesUrl = repositoriesUrl + self.slug = slug + self.ldapDn = ldapDn + self._type = _type + self.organizationId = organizationId + self.enterpriseId = enterpriseId + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case membersUrl = "members_url" + case name + case description + case permission + case privacy + case notificationSetting = "notification_setting" + case htmlUrl = "html_url" + case repositoriesUrl = "repositories_url" + case slug + case ldapDn = "ldap_dn" + case _type = "type" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" + } + } + /// Groups of organization members that gives permissions on specified repositories. + /// + /// - Remark: Generated from `#/components/schemas/team`. + public struct Team: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/team/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/team/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/team/slug`. + public var slug: Swift.String + /// - Remark: Generated from `#/components/schemas/team/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/privacy`. + public var privacy: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/notification_setting`. + public var notificationSetting: Swift.String? + /// - Remark: Generated from `#/components/schemas/team/permission`. + public var permission: Swift.String + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public struct PermissionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team/permissions/pull`. + public var pull: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/triage`. + public var triage: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/push`. + public var push: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/maintain`. + public var maintain: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team/permissions/admin`. + public var admin: Swift.Bool + /// Creates a new `PermissionsPayload`. + /// + /// - Parameters: + /// - pull: + /// - triage: + /// - push: + /// - maintain: + /// - admin: + public init( + pull: Swift.Bool, + triage: Swift.Bool, + push: Swift.Bool, + maintain: Swift.Bool, + admin: Swift.Bool + ) { + self.pull = pull + self.triage = triage + self.push = push + self.maintain = maintain + self.admin = admin + } + public enum CodingKeys: String, CodingKey { + case pull + case triage + case push + case maintain + case admin + } + } + /// - Remark: Generated from `#/components/schemas/team/permissions`. + public var permissions: Components.Schemas.Team.PermissionsPayload? + /// - Remark: Generated from `#/components/schemas/team/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/members_url`. + public var membersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team/repositories_url`. + public var repositoriesUrl: Swift.String + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case enterprise = "enterprise" + case organization = "organization" + } + /// The ownership type of the team + /// + /// - Remark: Generated from `#/components/schemas/team/type`. + public var _type: Components.Schemas.Team._TypePayload + /// How the team's access to the repository was granted. This property is only + /// present when the team is returned in a repository context, such as + /// `GET /repos/{owner}/{repo}/teams`. + /// + /// - Remark: Generated from `#/components/schemas/team/access_source`. + @frozen public enum AccessSourcePayload: String, Codable, Hashable, Sendable, CaseIterable { + case direct = "direct" + case organization = "organization" + case enterprise = "enterprise" + } + /// How the team's access to the repository was granted. This property is only + /// present when the team is returned in a repository context, such as + /// `GET /repos/{owner}/{repo}/teams`. + /// + /// - Remark: Generated from `#/components/schemas/team/access_source`. + public var accessSource: Components.Schemas.Team.AccessSourcePayload? + /// Unique identifier of the organization to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/organization_id`. + public var organizationId: Swift.Int? + /// Unique identifier of the enterprise to which this team belongs + /// + /// - Remark: Generated from `#/components/schemas/team/enterprise_id`. + public var enterpriseId: Swift.Int? + /// - Remark: Generated from `#/components/schemas/team/parent`. + public var parent: Components.Schemas.NullableTeamSimple? + /// Creates a new `Team`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - name: + /// - slug: + /// - description: + /// - privacy: + /// - notificationSetting: + /// - permission: + /// - permissions: + /// - url: + /// - htmlUrl: + /// - membersUrl: + /// - repositoriesUrl: + /// - _type: The ownership type of the team + /// - accessSource: How the team's access to the repository was granted. This property is only + /// - organizationId: Unique identifier of the organization to which this team belongs + /// - enterpriseId: Unique identifier of the enterprise to which this team belongs + /// - parent: + public init( + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + slug: Swift.String, + description: Swift.String? = nil, + privacy: Swift.String? = nil, + notificationSetting: Swift.String? = nil, + permission: Swift.String, + permissions: Components.Schemas.Team.PermissionsPayload? = nil, + url: Swift.String, + htmlUrl: Swift.String, + membersUrl: Swift.String, + repositoriesUrl: Swift.String, + _type: Components.Schemas.Team._TypePayload, + accessSource: Components.Schemas.Team.AccessSourcePayload? = nil, + organizationId: Swift.Int? = nil, + enterpriseId: Swift.Int? = nil, + parent: Components.Schemas.NullableTeamSimple? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.slug = slug + self.description = description + self.privacy = privacy + self.notificationSetting = notificationSetting + self.permission = permission + self.permissions = permissions + self.url = url + self.htmlUrl = htmlUrl + self.membersUrl = membersUrl + self.repositoriesUrl = repositoriesUrl + self._type = _type + self.accessSource = accessSource + self.organizationId = organizationId + self.enterpriseId = enterpriseId + self.parent = parent + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case slug + case description + case privacy + case notificationSetting = "notification_setting" + case permission + case permissions + case url + case htmlUrl = "html_url" + case membersUrl = "members_url" + case repositoriesUrl = "repositories_url" + case _type = "type" + case accessSource = "access_source" + case organizationId = "organization_id" + case enterpriseId = "enterprise_id" + case parent } } /// The name of the tool used to generate the code scanning analysis. @@ -2151,6 +3458,585 @@ public enum Components { case assignees } } + /// Hypermedia Link + /// + /// - Remark: Generated from `#/components/schemas/link`. + public struct Link: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/link/href`. + public var href: Swift.String + /// Creates a new `Link`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// The status of auto merging a pull request. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge`. + public struct AutoMerge: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/auto-merge/enabled_by`. + public var enabledBy: Components.Schemas.SimpleUser + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + @frozen public enum MergeMethodPayload: String, Codable, Hashable, Sendable, CaseIterable { + case merge = "merge" + case squash = "squash" + case rebase = "rebase" + } + /// The merge method to use. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/merge_method`. + public var mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload + /// Title for the merge commit message. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_title`. + public var commitTitle: Swift.String + /// Commit message for the merge commit. + /// + /// - Remark: Generated from `#/components/schemas/auto-merge/commit_message`. + public var commitMessage: Swift.String + /// Creates a new `AutoMerge`. + /// + /// - Parameters: + /// - enabledBy: + /// - mergeMethod: The merge method to use. + /// - commitTitle: Title for the merge commit message. + /// - commitMessage: Commit message for the merge commit. + public init( + enabledBy: Components.Schemas.SimpleUser, + mergeMethod: Components.Schemas.AutoMerge.MergeMethodPayload, + commitTitle: Swift.String, + commitMessage: Swift.String + ) { + self.enabledBy = enabledBy + self.mergeMethod = mergeMethod + self.commitTitle = commitTitle + self.commitMessage = commitMessage + } + public enum CodingKeys: String, CodingKey { + case enabledBy = "enabled_by" + case mergeMethod = "merge_method" + case commitTitle = "commit_title" + case commitMessage = "commit_message" + } + } + /// The stack information associated with a pull request. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack`. + public struct PullRequestStack: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// The base ref of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/ref`. + public var ref: Swift.String + /// The base SHA of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/sha`. + public var sha: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: The base ref of the stack this pull request belongs to. + /// - sha: The base SHA of the stack this pull request belongs to. + public init( + ref: Swift.String, + sha: Swift.String + ) { + self.ref = ref + self.sha = sha + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public var base: Components.Schemas.PullRequestStack.BasePayload + /// The total number of pull requests in the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/size`. + public var size: Swift.Int? + /// The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/position`. + public var position: Swift.Int? + /// The ID of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/id`. + public var id: Swift.Int? + /// The number of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/number`. + public var number: Swift.Int? + /// Creates a new `PullRequestStack`. + /// + /// - Parameters: + /// - base: + /// - size: The total number of pull requests in the stack. + /// - position: The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// - id: The ID of the stack that this pull request belongs to. + /// - number: The number of the stack that this pull request belongs to. + public init( + base: Components.Schemas.PullRequestStack.BasePayload, + size: Swift.Int? = nil, + position: Swift.Int? = nil, + id: Swift.Int? = nil, + number: Swift.Int? = nil + ) { + self.base = base + self.size = size + self.position = position + self.id = id + self.number = number + } + public enum CodingKeys: String, CodingKey { + case base + case size + case position + case id + case number + } + } + /// Pull Request Simple + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple`. + public struct PullRequestSimple: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/diff_url`. + public var diffUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/patch_url`. + public var patchUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/commits_url`. + public var commitsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comments_url`. + public var reviewCommentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/review_comment_url`. + public var reviewCommentUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/comments_url`. + public var commentsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/statuses_url`. + public var statusesUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-simple/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/locked`. + public var locked: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-simple/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/color`. + public var color: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/LabelsPayload/default`. + public var _default: Swift.Bool + /// Creates a new `LabelsPayloadPayload`. + /// + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: + /// - name: + /// - description: + /// - color: + /// - _default: + public init( + id: Swift.Int64, + nodeId: Swift.String, + url: Swift.String, + name: Swift.String, + description: Swift.String, + color: Swift.String, + _default: Swift.Bool + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.name = name + self.description = description + self.color = color + self._default = _default + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case name + case description + case color + case _default = "default" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public typealias LabelsPayload = [Components.Schemas.PullRequestSimple.LabelsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-simple/labels`. + public var labels: Components.Schemas.PullRequestSimple.LabelsPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/milestone`. + public var milestone: Components.Schemas.NullableMilestone? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/active_lock_reason`. + public var activeLockReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-simple/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/merge_commit_sha`. + public var mergeCommitSha: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignee`. + public var assignee: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/assignees`. + public var assignees: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_reviewers`. + public var requestedReviewers: [Components.Schemas.SimpleUser]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/requested_teams`. + public var requestedTeams: [Components.Schemas.Team]? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/head`. + public var head: Components.Schemas.PullRequestSimple.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/repo`. + public var repo: Components.Schemas.Repository + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - label: + /// - ref: + /// - repo: + /// - sha: + /// - user: + public init( + label: Swift.String, + ref: Swift.String, + repo: Components.Schemas.Repository, + sha: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.label = label + self.ref = ref + self.repo = repo + self.sha = sha + self.user = user + } + public enum CodingKeys: String, CodingKey { + case label + case ref + case repo + case sha + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/base`. + public var base: Components.Schemas.PullRequestSimple.BasePayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/comments`. + public var comments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/commits`. + public var commits: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/statuses`. + public var statuses: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/html`. + public var html: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/issue`. + public var issue: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comments`. + public var reviewComments: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/review_comment`. + public var reviewComment: Components.Schemas.Link + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links/self`. + public var _self: Components.Schemas.Link + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - comments: + /// - commits: + /// - statuses: + /// - html: + /// - issue: + /// - reviewComments: + /// - reviewComment: + /// - _self: + public init( + comments: Components.Schemas.Link, + commits: Components.Schemas.Link, + statuses: Components.Schemas.Link, + html: Components.Schemas.Link, + issue: Components.Schemas.Link, + reviewComments: Components.Schemas.Link, + reviewComment: Components.Schemas.Link, + _self: Components.Schemas.Link + ) { + self.comments = comments + self.commits = commits + self.statuses = statuses + self.html = html + self.issue = issue + self.reviewComments = reviewComments + self.reviewComment = reviewComment + self._self = _self + } + public enum CodingKeys: String, CodingKey { + case comments + case commits + case statuses + case html + case issue + case reviewComments = "review_comments" + case reviewComment = "review_comment" + case _self = "self" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-simple/_links`. + public var _links: Components.Schemas.PullRequestSimple._LinksPayload + /// - Remark: Generated from `#/components/schemas/pull-request-simple/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. + public var autoMerge: Components.Schemas.AutoMerge? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/stack`. + public var stack: Components.Schemas.PullRequestStack? + /// Indicates whether or not the pull request is a draft. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. + public var draft: Swift.Bool? + /// Creates a new `PullRequestSimple`. + /// + /// - Parameters: + /// - url: + /// - id: + /// - nodeId: + /// - htmlUrl: + /// - diffUrl: + /// - patchUrl: + /// - issueUrl: + /// - commitsUrl: + /// - reviewCommentsUrl: + /// - reviewCommentUrl: + /// - commentsUrl: + /// - statusesUrl: + /// - number: + /// - state: + /// - locked: + /// - title: + /// - user: + /// - body: + /// - labels: + /// - milestone: + /// - activeLockReason: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - mergedAt: + /// - mergeCommitSha: + /// - assignee: + /// - assignees: + /// - requestedReviewers: + /// - requestedTeams: + /// - head: + /// - base: + /// - _links: + /// - authorAssociation: + /// - autoMerge: + /// - stack: + /// - draft: Indicates whether or not the pull request is a draft. + public init( + url: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + htmlUrl: Swift.String, + diffUrl: Swift.String, + patchUrl: Swift.String, + issueUrl: Swift.String, + commitsUrl: Swift.String, + reviewCommentsUrl: Swift.String, + reviewCommentUrl: Swift.String, + commentsUrl: Swift.String, + statusesUrl: Swift.String, + number: Swift.Int, + state: Swift.String, + locked: Swift.Bool, + title: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String? = nil, + labels: Components.Schemas.PullRequestSimple.LabelsPayload, + milestone: Components.Schemas.NullableMilestone? = nil, + activeLockReason: Swift.String? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + mergedAt: Foundation.Date? = nil, + mergeCommitSha: Swift.String? = nil, + assignee: Components.Schemas.NullableSimpleUser? = nil, + assignees: [Components.Schemas.SimpleUser]? = nil, + requestedReviewers: [Components.Schemas.SimpleUser]? = nil, + requestedTeams: [Components.Schemas.Team]? = nil, + head: Components.Schemas.PullRequestSimple.HeadPayload, + base: Components.Schemas.PullRequestSimple.BasePayload, + _links: Components.Schemas.PullRequestSimple._LinksPayload, + authorAssociation: Components.Schemas.AuthorAssociation, + autoMerge: Components.Schemas.AutoMerge? = nil, + stack: Components.Schemas.PullRequestStack? = nil, + draft: Swift.Bool? = nil + ) { + self.url = url + self.id = id + self.nodeId = nodeId + self.htmlUrl = htmlUrl + self.diffUrl = diffUrl + self.patchUrl = patchUrl + self.issueUrl = issueUrl + self.commitsUrl = commitsUrl + self.reviewCommentsUrl = reviewCommentsUrl + self.reviewCommentUrl = reviewCommentUrl + self.commentsUrl = commentsUrl + self.statusesUrl = statusesUrl + self.number = number + self.state = state + self.locked = locked + self.title = title + self.user = user + self.body = body + self.labels = labels + self.milestone = milestone + self.activeLockReason = activeLockReason + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.mergedAt = mergedAt + self.mergeCommitSha = mergeCommitSha + self.assignee = assignee + self.assignees = assignees + self.requestedReviewers = requestedReviewers + self.requestedTeams = requestedTeams + self.head = head + self.base = base + self._links = _links + self.authorAssociation = authorAssociation + self.autoMerge = autoMerge + self.stack = stack + self.draft = draft + } + public enum CodingKeys: String, CodingKey { + case url + case id + case nodeId = "node_id" + case htmlUrl = "html_url" + case diffUrl = "diff_url" + case patchUrl = "patch_url" + case issueUrl = "issue_url" + case commitsUrl = "commits_url" + case reviewCommentsUrl = "review_comments_url" + case reviewCommentUrl = "review_comment_url" + case commentsUrl = "comments_url" + case statusesUrl = "statuses_url" + case number + case state + case locked + case title + case user + case body + case labels + case milestone + case activeLockReason = "active_lock_reason" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case mergedAt = "merged_at" + case mergeCommitSha = "merge_commit_sha" + case assignee + case assignees + case requestedReviewers = "requested_reviewers" + case requestedTeams = "requested_teams" + case head + case base + case _links + case authorAssociation = "author_association" + case autoMerge = "auto_merge" + case stack + case draft + } + } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items`. public struct CodeScanningAlertItems: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/code-scanning-alert-items/number`. @@ -2401,6 +4287,10 @@ public enum Components { public var dismissalApprovedBy: Components.Schemas.NullableSimpleUser? /// - Remark: Generated from `#/components/schemas/code-scanning-alert/assignees`. public var assignees: [Components.Schemas.SimpleUser]? + /// Pull requests linked to this alert. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert/linked_pull_requests`. + public var linkedPullRequests: [Components.Schemas.PullRequestSimple]? /// Creates a new `CodeScanningAlert`. /// /// - Parameters: @@ -2421,6 +4311,7 @@ public enum Components { /// - mostRecentInstance: /// - dismissalApprovedBy: /// - assignees: + /// - linkedPullRequests: Pull requests linked to this alert. public init( number: Components.Schemas.AlertNumber, createdAt: Components.Schemas.AlertCreatedAt, @@ -2438,7 +4329,8 @@ public enum Components { tool: Components.Schemas.CodeScanningAnalysisTool, mostRecentInstance: Components.Schemas.CodeScanningAlertInstance, dismissalApprovedBy: Components.Schemas.NullableSimpleUser? = nil, - assignees: [Components.Schemas.SimpleUser]? = nil + assignees: [Components.Schemas.SimpleUser]? = nil, + linkedPullRequests: [Components.Schemas.PullRequestSimple]? = nil ) { self.number = number self.createdAt = createdAt @@ -2457,6 +4349,7 @@ public enum Components { self.mostRecentInstance = mostRecentInstance self.dismissalApprovedBy = dismissalApprovedBy self.assignees = assignees + self.linkedPullRequests = linkedPullRequests } public enum CodingKeys: String, CodingKey { case number @@ -2476,6 +4369,7 @@ public enum Components { case mostRecentInstance = "most_recent_instance" case dismissalApprovedBy = "dismissal_approved_by" case assignees + case linkedPullRequests = "linked_pull_requests" } } /// The status of an autofix. @@ -3864,6 +5758,34 @@ public enum Components { /// Creates a new `NotModified`. public init() {} } + public struct InternalError: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.InternalError.Body + /// Creates a new `InternalError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.InternalError.Body) { + self.body = body + } + } public struct ServiceUnavailable: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/service_unavailable/content`. @frozen public enum Body: Sendable, Hashable { @@ -5546,24 +7468,24 @@ public enum Operations { } } } - /// Service unavailable + /// Internal Error /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/get(code-scanning/get-autofix)/responses/500`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { get throws { switch self { - case let .serviceUnavailable(response): + case let .internalServerError(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "internalServerError", response: self ) } @@ -5878,24 +7800,24 @@ public enum Operations { } } } - /// Service unavailable + /// Internal Error /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/post(code-scanning/create-autofix)/responses/500`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { get throws { switch self { - case let .serviceUnavailable(response): + case let .internalServerError(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "internalServerError", response: self ) } From fafa109c040027c4d270e7d25509a059db2b8c8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:38:35 +0000 Subject: [PATCH 06/18] Commit via running: make Sources/issues --- Sources/issues/Client.swift | 460 + Sources/issues/Types.swift | 18757 +++++++++++++++++++--------------- 2 files changed, 11020 insertions(+), 8197 deletions(-) diff --git a/Sources/issues/Client.swift b/Sources/issues/Client.swift index 7c06f7ccb3..99889f505e 100644 --- a/Sources/issues/Client.swift +++ b/Sources/issues/Client.swift @@ -6272,6 +6272,428 @@ public struct Client: APIProtocol { } ) } + /// List issue suggestions + /// + /// Lists the suggestions on an issue. A suggestion is an agent-proposed change to an issue's type, labels, fields, assignees, or closed state that a maintainer can approve or dismiss. + /// + /// By default only pending suggestions are returned. Use `state=all` to return suggestions in every state, or `state=` to filter to a single state. Use `action=` to return only suggestions for a specific change. + /// + /// This endpoint is only available while the issue suggestions feature is enabled for the repository, and only supports issues, not pull requests. + /// + /// Requires triage access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/suggestions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/get(issues/list-suggestions)`. + public func issuesListSuggestions(_ input: Operations.IssuesListSuggestions.Input) async throws -> Operations.IssuesListSuggestions.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesListSuggestions.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/suggestions", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "action", + value: input.query.action + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.IssuesListSuggestions.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.IssuesListSuggestions.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.IssueSuggestion].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Approve an issue suggestion + /// + /// Approves a pending suggestion on an issue. Applies the proposed change (creating the corresponding timeline event), transitions the suggestion to `approved`, and dismisses any competing pending suggestions for the same change. + /// + /// Requires triage access to the repository. Approving a suggestion also requires permission to perform the change it applies (for example, setting the issue type, adding a label or assignee, or closing the issue); this only affects fine-grained access tokens and GitHub Apps whose permissions are narrower than the triage role. This endpoint only supports issues, not pull requests. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)`. + public func issuesApproveSuggestion(_ input: Operations.IssuesApproveSuggestion.Input) async throws -> Operations.IssuesApproveSuggestion.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesApproveSuggestion.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/suggestions/{}/approve", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber, + input.path.suggestionId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesApproveSuggestion.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.IssueSuggestion.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Dismiss an issue suggestion + /// + /// Dismisses a pending suggestion on an issue. Transitions the suggestion to `dismissed` without applying any change or creating a timeline event. + /// + /// Requires triage access to the repository. This endpoint only supports issues, not pull requests. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)`. + public func issuesDismissSuggestion(_ input: Operations.IssuesDismissSuggestion.Input) async throws -> Operations.IssuesDismissSuggestion.Output { + try await client.send( + input: input, + forOperation: Operations.IssuesDismissSuggestion.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issues/{}/suggestions/{}/dismiss", + parameters: [ + input.path.owner, + input.path.repo, + input.path.issueNumber, + input.path.suggestionId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.IssuesDismissSuggestion.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.IssueSuggestion.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List timeline events for an issue /// /// List all timeline events for an issue. @@ -6310,6 +6732,13 @@ public struct Client: APIProtocol { name: "page", value: input.query.page ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "exclude", + value: input.query.exclude + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -6370,6 +6799,37 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) case 410: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Gone.Body diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 9219d2d5cc..68ad3fd5e0 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -530,6 +530,37 @@ public protocol APIProtocol: Sendable { /// - 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 issuesReprioritizeSubIssue(_ input: Operations.IssuesReprioritizeSubIssue.Input) async throws -> Operations.IssuesReprioritizeSubIssue.Output + /// List issue suggestions + /// + /// Lists the suggestions on an issue. A suggestion is an agent-proposed change to an issue's type, labels, fields, assignees, or closed state that a maintainer can approve or dismiss. + /// + /// By default only pending suggestions are returned. Use `state=all` to return suggestions in every state, or `state=` to filter to a single state. Use `action=` to return only suggestions for a specific change. + /// + /// This endpoint is only available while the issue suggestions feature is enabled for the repository, and only supports issues, not pull requests. + /// + /// Requires triage access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/suggestions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/get(issues/list-suggestions)`. + func issuesListSuggestions(_ input: Operations.IssuesListSuggestions.Input) async throws -> Operations.IssuesListSuggestions.Output + /// Approve an issue suggestion + /// + /// Approves a pending suggestion on an issue. Applies the proposed change (creating the corresponding timeline event), transitions the suggestion to `approved`, and dismisses any competing pending suggestions for the same change. + /// + /// Requires triage access to the repository. Approving a suggestion also requires permission to perform the change it applies (for example, setting the issue type, adding a label or assignee, or closing the issue); this only affects fine-grained access tokens and GitHub Apps whose permissions are narrower than the triage role. This endpoint only supports issues, not pull requests. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)`. + func issuesApproveSuggestion(_ input: Operations.IssuesApproveSuggestion.Input) async throws -> Operations.IssuesApproveSuggestion.Output + /// Dismiss an issue suggestion + /// + /// Dismisses a pending suggestion on an issue. Transitions the suggestion to `dismissed` without applying any change or creating a timeline event. + /// + /// Requires triage access to the repository. This endpoint only supports issues, not pull requests. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)`. + func issuesDismissSuggestion(_ input: Operations.IssuesDismissSuggestion.Input) async throws -> Operations.IssuesDismissSuggestion.Output /// List timeline events for an issue /// /// List all timeline events for an issue. @@ -1538,6 +1569,63 @@ extension APIProtocol { body: body )) } + /// List issue suggestions + /// + /// Lists the suggestions on an issue. A suggestion is an agent-proposed change to an issue's type, labels, fields, assignees, or closed state that a maintainer can approve or dismiss. + /// + /// By default only pending suggestions are returned. Use `state=all` to return suggestions in every state, or `state=` to filter to a single state. Use `action=` to return only suggestions for a specific change. + /// + /// This endpoint is only available while the issue suggestions feature is enabled for the repository, and only supports issues, not pull requests. + /// + /// Requires triage access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/suggestions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/get(issues/list-suggestions)`. + public func issuesListSuggestions( + path: Operations.IssuesListSuggestions.Input.Path, + query: Operations.IssuesListSuggestions.Input.Query = .init(), + headers: Operations.IssuesListSuggestions.Input.Headers = .init() + ) async throws -> Operations.IssuesListSuggestions.Output { + try await issuesListSuggestions(Operations.IssuesListSuggestions.Input( + path: path, + query: query, + headers: headers + )) + } + /// Approve an issue suggestion + /// + /// Approves a pending suggestion on an issue. Applies the proposed change (creating the corresponding timeline event), transitions the suggestion to `approved`, and dismisses any competing pending suggestions for the same change. + /// + /// Requires triage access to the repository. Approving a suggestion also requires permission to perform the change it applies (for example, setting the issue type, adding a label or assignee, or closing the issue); this only affects fine-grained access tokens and GitHub Apps whose permissions are narrower than the triage role. This endpoint only supports issues, not pull requests. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)`. + public func issuesApproveSuggestion( + path: Operations.IssuesApproveSuggestion.Input.Path, + headers: Operations.IssuesApproveSuggestion.Input.Headers = .init() + ) async throws -> Operations.IssuesApproveSuggestion.Output { + try await issuesApproveSuggestion(Operations.IssuesApproveSuggestion.Input( + path: path, + headers: headers + )) + } + /// Dismiss an issue suggestion + /// + /// Dismisses a pending suggestion on an issue. Transitions the suggestion to `dismissed` without applying any change or creating a timeline event. + /// + /// Requires triage access to the repository. This endpoint only supports issues, not pull requests. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)`. + public func issuesDismissSuggestion( + path: Operations.IssuesDismissSuggestion.Input.Path, + headers: Operations.IssuesDismissSuggestion.Input.Headers = .init() + ) async throws -> Operations.IssuesDismissSuggestion.Output { + try await issuesDismissSuggestion(Operations.IssuesDismissSuggestion.Input( + path: path, + headers: headers + )) + } /// List timeline events for an issue /// /// List all timeline events for an issue. @@ -6473,45 +6561,45 @@ public enum Components { } /// A minimal reference to an issue linked from a timeline event (e.g. sub-issue, parent-issue, or dependency events). /// - /// - Remark: Generated from `#/components/schemas/issue-reference`. - public struct IssueReference: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference`. + public struct NullableIssueReference: Codable, Hashable, Sendable { /// The number of the referenced issue. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/number`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/number`. public var number: Swift.Int /// The title of the referenced issue. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/title`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/title`. public var title: Swift.String /// The state of the referenced issue. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/state`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/state`. public var state: Swift.String /// The reason for the referenced issue's state. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/state_reason`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/state_reason`. public var stateReason: Swift.String? - /// - Remark: Generated from `#/components/schemas/issue-reference/repository`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/repository`. public var repository: Components.Schemas.SimpleRepository /// The type of the referenced issue. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/issue_type`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/issue_type`. public struct IssueTypePayload: Codable, Hashable, Sendable { /// The unique identifier of the issue type. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/issue_type/id`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/issue_type/id`. public var id: Swift.Int /// The node identifier of the issue type. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/issue_type/node_id`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/issue_type/node_id`. public var nodeId: Swift.String /// The name of the issue type. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/issue_type/name`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/issue_type/name`. public var name: Swift.String /// The color of the issue type. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/issue_type/color`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/issue_type/color`. public var color: Swift.String? /// Creates a new `IssueTypePayload`. /// @@ -6540,9 +6628,9 @@ public enum Components { } /// The type of the referenced issue. /// - /// - Remark: Generated from `#/components/schemas/issue-reference/issue_type`. - public var issueType: Components.Schemas.IssueReference.IssueTypePayload? - /// Creates a new `IssueReference`. + /// - Remark: Generated from `#/components/schemas/nullable-issue-reference/issue_type`. + public var issueType: Components.Schemas.NullableIssueReference.IssueTypePayload? + /// Creates a new `NullableIssueReference`. /// /// - Parameters: /// - number: The number of the referenced issue. @@ -6557,7 +6645,7 @@ public enum Components { state: Swift.String, stateReason: Swift.String? = nil, repository: Components.Schemas.SimpleRepository, - issueType: Components.Schemas.IssueReference.IssueTypePayload? = nil + issueType: Components.Schemas.NullableIssueReference.IssueTypePayload? = nil ) { self.number = number self.title = title @@ -6575,6 +6663,43 @@ public enum Components { case issueType = "issue_type" } } + /// The intent behind an agent's action on an issue, including the rationale and confidence. Present (and `null` when the event carried no agent intent) on supported event types while the issue suggestions feature is enabled for the repository; the property is omitted entirely when the feature is disabled or the event type does not support intent. + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-event-intent`. + public struct NullableIssueEventIntent: Codable, Hashable, Sendable { + /// The reasoning the agent provided for the change. + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-event-intent/rationale`. + public var rationale: Swift.String? + /// The confidence level the agent had when performing this action. + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-event-intent/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "LOW" + case medium = "MEDIUM" + case high = "HIGH" + } + /// The confidence level the agent had when performing this action. + /// + /// - Remark: Generated from `#/components/schemas/nullable-issue-event-intent/confidence`. + public var confidence: Components.Schemas.NullableIssueEventIntent.ConfidencePayload? + /// Creates a new `NullableIssueEventIntent`. + /// + /// - Parameters: + /// - rationale: The reasoning the agent provided for the change. + /// - confidence: The confidence level the agent had when performing this action. + public init( + rationale: Swift.String? = nil, + confidence: Components.Schemas.NullableIssueEventIntent.ConfidencePayload? = nil + ) { + self.rationale = rationale + self.confidence = confidence + } + public enum CodingKeys: String, CodingKey { + case rationale + case confidence + } + } /// Issue Event /// /// - Remark: Generated from `#/components/schemas/issue-event`. @@ -6622,9 +6747,15 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/issue-event/prev_issue_type`. public var prevIssueType: Components.Schemas.IssueTypeWebhook? /// - Remark: Generated from `#/components/schemas/issue-event/sub_issue`. - public var subIssue: Components.Schemas.IssueReference? + public var subIssue: Components.Schemas.NullableIssueReference? /// - Remark: Generated from `#/components/schemas/issue-event/parent_issue`. - public var parentIssue: Components.Schemas.IssueReference? + public var parentIssue: Components.Schemas.NullableIssueReference? + /// - Remark: Generated from `#/components/schemas/issue-event/blocked_by`. + public var blockedBy: Components.Schemas.NullableIssueReference? + /// - Remark: Generated from `#/components/schemas/issue-event/blocking`. + public var blocking: Components.Schemas.NullableIssueReference? + /// - Remark: Generated from `#/components/schemas/issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? /// - Remark: Generated from `#/components/schemas/issue-event/author_association`. public var authorAssociation: Components.Schemas.AuthorAssociation? /// - Remark: Generated from `#/components/schemas/issue-event/lock_reason`. @@ -6657,6 +6788,9 @@ public enum Components { /// - prevIssueType: /// - subIssue: /// - parentIssue: + /// - blockedBy: + /// - blocking: + /// - intent: /// - authorAssociation: /// - lockReason: /// - performedViaGithubApp: @@ -6682,8 +6816,11 @@ public enum Components { rename: Components.Schemas.IssueEventRename? = nil, issueType: Components.Schemas.IssueTypeWebhook? = nil, prevIssueType: Components.Schemas.IssueTypeWebhook? = nil, - subIssue: Components.Schemas.IssueReference? = nil, - parentIssue: Components.Schemas.IssueReference? = nil, + subIssue: Components.Schemas.NullableIssueReference? = nil, + parentIssue: Components.Schemas.NullableIssueReference? = nil, + blockedBy: Components.Schemas.NullableIssueReference? = nil, + blocking: Components.Schemas.NullableIssueReference? = nil, + intent: Components.Schemas.NullableIssueEventIntent? = nil, authorAssociation: Components.Schemas.AuthorAssociation? = nil, lockReason: Swift.String? = nil, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil @@ -6711,6 +6848,9 @@ public enum Components { self.prevIssueType = prevIssueType self.subIssue = subIssue self.parentIssue = parentIssue + self.blockedBy = blockedBy + self.blocking = blocking + self.intent = intent self.authorAssociation = authorAssociation self.lockReason = lockReason self.performedViaGithubApp = performedViaGithubApp @@ -6739,6 +6879,9 @@ public enum Components { case prevIssueType = "prev_issue_type" case subIssue = "sub_issue" case parentIssue = "parent_issue" + case blockedBy = "blocked_by" + case blocking + case intent case authorAssociation = "author_association" case lockReason = "lock_reason" case performedViaGithubApp = "performed_via_github_app" @@ -6791,6 +6934,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/labeled-issue-event/label`. public var label: Components.Schemas.LabeledIssueEvent.LabelPayload + /// - Remark: Generated from `#/components/schemas/labeled-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? /// Creates a new `LabeledIssueEvent`. /// /// - Parameters: @@ -6804,6 +6949,7 @@ public enum Components { /// - createdAt: /// - performedViaGithubApp: /// - label: + /// - intent: public init( id: Swift.Int, nodeId: Swift.String, @@ -6814,7 +6960,8 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - label: Components.Schemas.LabeledIssueEvent.LabelPayload + label: Components.Schemas.LabeledIssueEvent.LabelPayload, + intent: Components.Schemas.NullableIssueEventIntent? = nil ) { self.id = id self.nodeId = nodeId @@ -6826,6 +6973,7 @@ public enum Components { self.createdAt = createdAt self.performedViaGithubApp = performedViaGithubApp self.label = label + self.intent = intent } public enum CodingKeys: String, CodingKey { case id @@ -6838,6 +6986,7 @@ public enum Components { case createdAt = "created_at" case performedViaGithubApp = "performed_via_github_app" case label + case intent } } /// Unlabeled Issue Event @@ -6887,6 +7036,8 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/unlabeled-issue-event/label`. public var label: Components.Schemas.UnlabeledIssueEvent.LabelPayload + /// - Remark: Generated from `#/components/schemas/unlabeled-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? /// Creates a new `UnlabeledIssueEvent`. /// /// - Parameters: @@ -6900,6 +7051,7 @@ public enum Components { /// - createdAt: /// - performedViaGithubApp: /// - label: + /// - intent: public init( id: Swift.Int, nodeId: Swift.String, @@ -6910,7 +7062,8 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - label: Components.Schemas.UnlabeledIssueEvent.LabelPayload + label: Components.Schemas.UnlabeledIssueEvent.LabelPayload, + intent: Components.Schemas.NullableIssueEventIntent? = nil ) { self.id = id self.nodeId = nodeId @@ -6922,6 +7075,7 @@ public enum Components { self.createdAt = createdAt self.performedViaGithubApp = performedViaGithubApp self.label = label + self.intent = intent } public enum CodingKeys: String, CodingKey { case id @@ -6934,6 +7088,7 @@ public enum Components { case createdAt = "created_at" case performedViaGithubApp = "performed_via_github_app" case label + case intent } } /// Assigned Issue Event @@ -6962,6 +7117,8 @@ public enum Components { public var assignee: Components.Schemas.SimpleUser /// - Remark: Generated from `#/components/schemas/assigned-issue-event/assigner`. public var assigner: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/assigned-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? /// Creates a new `AssignedIssueEvent`. /// /// - Parameters: @@ -6976,6 +7133,7 @@ public enum Components { /// - performedViaGithubApp: /// - assignee: /// - assigner: + /// - intent: public init( id: Swift.Int, nodeId: Swift.String, @@ -6987,7 +7145,8 @@ public enum Components { createdAt: Swift.String, performedViaGithubApp: Components.Schemas.Integration? = nil, assignee: Components.Schemas.SimpleUser, - assigner: Components.Schemas.SimpleUser + assigner: Components.Schemas.SimpleUser, + intent: Components.Schemas.NullableIssueEventIntent? = nil ) { self.id = id self.nodeId = nodeId @@ -7000,6 +7159,7 @@ public enum Components { self.performedViaGithubApp = performedViaGithubApp self.assignee = assignee self.assigner = assigner + self.intent = intent } public enum CodingKeys: String, CodingKey { case id @@ -7013,6 +7173,7 @@ public enum Components { case performedViaGithubApp = "performed_via_github_app" case assignee case assigner + case intent } } /// Unassigned Issue Event @@ -8221,6 +8382,8 @@ public enum Components { public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue-type-added-issue-event/issue_type`. public var issueType: Components.Schemas.IssueTypeWebhook? + /// - Remark: Generated from `#/components/schemas/issue-type-added-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? /// Creates a new `IssueTypeAddedIssueEvent`. /// /// - Parameters: @@ -8234,6 +8397,7 @@ public enum Components { /// - createdAt: /// - performedViaGithubApp: /// - issueType: + /// - intent: public init( id: Swift.Int, nodeId: Swift.String, @@ -8244,7 +8408,8 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - issueType: Components.Schemas.IssueTypeWebhook? = nil + issueType: Components.Schemas.IssueTypeWebhook? = nil, + intent: Components.Schemas.NullableIssueEventIntent? = nil ) { self.id = id self.nodeId = nodeId @@ -8256,6 +8421,7 @@ public enum Components { self.createdAt = createdAt self.performedViaGithubApp = performedViaGithubApp self.issueType = issueType + self.intent = intent } public enum CodingKeys: String, CodingKey { case id @@ -8268,6 +8434,7 @@ public enum Components { case createdAt = "created_at" case performedViaGithubApp = "performed_via_github_app" case issueType = "issue_type" + case intent } } /// Issue Type Removed Issue Event @@ -8294,6 +8461,8 @@ public enum Components { public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/issue-type-removed-issue-event/prev_issue_type`. public var prevIssueType: Components.Schemas.IssueTypeWebhook? + /// - Remark: Generated from `#/components/schemas/issue-type-removed-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? /// Creates a new `IssueTypeRemovedIssueEvent`. /// /// - Parameters: @@ -8307,6 +8476,7 @@ public enum Components { /// - createdAt: /// - performedViaGithubApp: /// - prevIssueType: + /// - intent: public init( id: Swift.Int, nodeId: Swift.String, @@ -8317,7 +8487,8 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - prevIssueType: Components.Schemas.IssueTypeWebhook? = nil + prevIssueType: Components.Schemas.IssueTypeWebhook? = nil, + intent: Components.Schemas.NullableIssueEventIntent? = nil ) { self.id = id self.nodeId = nodeId @@ -8329,6 +8500,7 @@ public enum Components { self.createdAt = createdAt self.performedViaGithubApp = performedViaGithubApp self.prevIssueType = prevIssueType + self.intent = intent } public enum CodingKeys: String, CodingKey { case id @@ -8341,6 +8513,7 @@ public enum Components { case createdAt = "created_at" case performedViaGithubApp = "performed_via_github_app" case prevIssueType = "prev_issue_type" + case intent } } /// Issue Type Changed Issue Event @@ -8369,6 +8542,8 @@ public enum Components { public var issueType: Components.Schemas.IssueTypeWebhook? /// - Remark: Generated from `#/components/schemas/issue-type-changed-issue-event/prev_issue_type`. public var prevIssueType: Components.Schemas.IssueTypeWebhook? + /// - Remark: Generated from `#/components/schemas/issue-type-changed-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? /// Creates a new `IssueTypeChangedIssueEvent`. /// /// - Parameters: @@ -8383,6 +8558,7 @@ public enum Components { /// - performedViaGithubApp: /// - issueType: /// - prevIssueType: + /// - intent: public init( id: Swift.Int, nodeId: Swift.String, @@ -8394,7 +8570,8 @@ public enum Components { createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, issueType: Components.Schemas.IssueTypeWebhook? = nil, - prevIssueType: Components.Schemas.IssueTypeWebhook? = nil + prevIssueType: Components.Schemas.IssueTypeWebhook? = nil, + intent: Components.Schemas.NullableIssueEventIntent? = nil ) { self.id = id self.nodeId = nodeId @@ -8407,6 +8584,7 @@ public enum Components { self.performedViaGithubApp = performedViaGithubApp self.issueType = issueType self.prevIssueType = prevIssueType + self.intent = intent } public enum CodingKeys: String, CodingKey { case id @@ -8420,6 +8598,7 @@ public enum Components { case performedViaGithubApp = "performed_via_github_app" case issueType = "issue_type" case prevIssueType = "prev_issue_type" + case intent } } /// Sub-issue Added Issue Event @@ -8445,7 +8624,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/sub-issue-added-issue-event/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/sub-issue-added-issue-event/sub_issue`. - public var subIssue: Components.Schemas.IssueReference? + public var subIssue: Components.Schemas.NullableIssueReference? /// Creates a new `SubIssueAddedIssueEvent`. /// /// - Parameters: @@ -8469,7 +8648,7 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - subIssue: Components.Schemas.IssueReference? = nil + subIssue: Components.Schemas.NullableIssueReference? = nil ) { self.id = id self.nodeId = nodeId @@ -8518,7 +8697,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/sub-issue-removed-issue-event/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/sub-issue-removed-issue-event/sub_issue`. - public var subIssue: Components.Schemas.IssueReference? + public var subIssue: Components.Schemas.NullableIssueReference? /// Creates a new `SubIssueRemovedIssueEvent`. /// /// - Parameters: @@ -8542,7 +8721,7 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - subIssue: Components.Schemas.IssueReference? = nil + subIssue: Components.Schemas.NullableIssueReference? = nil ) { self.id = id self.nodeId = nodeId @@ -8591,7 +8770,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/parent-issue-added-issue-event/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/parent-issue-added-issue-event/parent_issue`. - public var parentIssue: Components.Schemas.IssueReference? + public var parentIssue: Components.Schemas.NullableIssueReference? /// Creates a new `ParentIssueAddedIssueEvent`. /// /// - Parameters: @@ -8615,7 +8794,7 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - parentIssue: Components.Schemas.IssueReference? = nil + parentIssue: Components.Schemas.NullableIssueReference? = nil ) { self.id = id self.nodeId = nodeId @@ -8664,7 +8843,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/parent-issue-removed-issue-event/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? /// - Remark: Generated from `#/components/schemas/parent-issue-removed-issue-event/parent_issue`. - public var parentIssue: Components.Schemas.IssueReference? + public var parentIssue: Components.Schemas.NullableIssueReference? /// Creates a new `ParentIssueRemovedIssueEvent`. /// /// - Parameters: @@ -8688,7 +8867,7 @@ public enum Components { commitUrl: Swift.String? = nil, createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - parentIssue: Components.Schemas.IssueReference? = nil + parentIssue: Components.Schemas.NullableIssueReference? = nil ) { self.id = id self.nodeId = nodeId @@ -8714,3418 +8893,3009 @@ public enum Components { case parentIssue = "parent_issue" } } - /// Issue Event for Issue + /// Blocked-by Added Issue Event /// - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue`. - public struct IssueEventForIssue: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value1`. - public var value1: Components.Schemas.LabeledIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value2`. - public var value2: Components.Schemas.UnlabeledIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value3`. - public var value3: Components.Schemas.AssignedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value4`. - public var value4: Components.Schemas.UnassignedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value5`. - public var value5: Components.Schemas.MilestonedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value6`. - public var value6: Components.Schemas.DemilestonedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value7`. - public var value7: Components.Schemas.RenamedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value8`. - public var value8: Components.Schemas.ReviewRequestedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value9`. - public var value9: Components.Schemas.ReviewRequestRemovedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value10`. - public var value10: Components.Schemas.ReviewDismissedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value11`. - public var value11: Components.Schemas.LockedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value12`. - public var value12: Components.Schemas.AddedToProjectIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value13`. - public var value13: Components.Schemas.MovedColumnInProjectIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value14`. - public var value14: Components.Schemas.RemovedFromProjectIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value15`. - public var value15: Components.Schemas.ConvertedNoteToIssueIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value16`. - public var value16: Components.Schemas.IssueTypeAddedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value17`. - public var value17: Components.Schemas.IssueTypeRemovedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value18`. - public var value18: Components.Schemas.IssueTypeChangedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value19`. - public var value19: Components.Schemas.SubIssueAddedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value20`. - public var value20: Components.Schemas.SubIssueRemovedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value21`. - public var value21: Components.Schemas.ParentIssueAddedIssueEvent? - /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value22`. - public var value22: Components.Schemas.ParentIssueRemovedIssueEvent? - /// Creates a new `IssueEventForIssue`. + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event`. + public struct BlockedByAddedIssueEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/commit_url`. + public var commitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/created_at`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/blocked-by-added-issue-event/blocked_by`. + public var blockedBy: Components.Schemas.NullableIssueReference? + /// Creates a new `BlockedByAddedIssueEvent`. /// /// - Parameters: - /// - value1: - /// - value2: - /// - value3: - /// - value4: - /// - value5: - /// - value6: - /// - value7: - /// - value8: - /// - value9: - /// - value10: - /// - value11: - /// - value12: - /// - value13: - /// - value14: - /// - value15: - /// - value16: - /// - value17: - /// - value18: - /// - value19: - /// - value20: - /// - value21: - /// - value22: + /// - id: + /// - nodeId: + /// - url: + /// - actor: + /// - event: + /// - commitId: + /// - commitUrl: + /// - createdAt: + /// - performedViaGithubApp: + /// - blockedBy: public init( - value1: Components.Schemas.LabeledIssueEvent? = nil, - value2: Components.Schemas.UnlabeledIssueEvent? = nil, - value3: Components.Schemas.AssignedIssueEvent? = nil, - value4: Components.Schemas.UnassignedIssueEvent? = nil, - value5: Components.Schemas.MilestonedIssueEvent? = nil, - value6: Components.Schemas.DemilestonedIssueEvent? = nil, - value7: Components.Schemas.RenamedIssueEvent? = nil, - value8: Components.Schemas.ReviewRequestedIssueEvent? = nil, - value9: Components.Schemas.ReviewRequestRemovedIssueEvent? = nil, - value10: Components.Schemas.ReviewDismissedIssueEvent? = nil, - value11: Components.Schemas.LockedIssueEvent? = nil, - value12: Components.Schemas.AddedToProjectIssueEvent? = nil, - value13: Components.Schemas.MovedColumnInProjectIssueEvent? = nil, - value14: Components.Schemas.RemovedFromProjectIssueEvent? = nil, - value15: Components.Schemas.ConvertedNoteToIssueIssueEvent? = nil, - value16: Components.Schemas.IssueTypeAddedIssueEvent? = nil, - value17: Components.Schemas.IssueTypeRemovedIssueEvent? = nil, - value18: Components.Schemas.IssueTypeChangedIssueEvent? = nil, - value19: Components.Schemas.SubIssueAddedIssueEvent? = nil, - value20: Components.Schemas.SubIssueRemovedIssueEvent? = nil, - value21: Components.Schemas.ParentIssueAddedIssueEvent? = nil, - value22: Components.Schemas.ParentIssueRemovedIssueEvent? = nil + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + actor: Components.Schemas.SimpleUser, + event: Swift.String, + commitId: Swift.String? = nil, + commitUrl: Swift.String? = nil, + createdAt: Swift.String, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + blockedBy: Components.Schemas.NullableIssueReference? = nil ) { - self.value1 = value1 - self.value2 = value2 - self.value3 = value3 - self.value4 = value4 - self.value5 = value5 - self.value6 = value6 - self.value7 = value7 - self.value8 = value8 - self.value9 = value9 - self.value10 = value10 - self.value11 = value11 - self.value12 = value12 - self.value13 = value13 - self.value14 = value14 - self.value15 = value15 - self.value16 = value16 - self.value17 = value17 - self.value18 = value18 - self.value19 = value19 - self.value20 = value20 - self.value21 = value21 - self.value22 = value22 + self.id = id + self.nodeId = nodeId + self.url = url + self.actor = actor + self.event = event + self.commitId = commitId + self.commitUrl = commitUrl + self.createdAt = createdAt + self.performedViaGithubApp = performedViaGithubApp + self.blockedBy = blockedBy } - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self.value1 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value2 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value3 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value4 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value5 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value6 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value7 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value8 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value9 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value10 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value11 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value12 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value13 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value14 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value15 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value16 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value17 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value18 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value19 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value20 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value21 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value22 = try .init(from: decoder) - } catch { - errors.append(error) - } - try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( - [ - self.value1, - self.value2, - self.value3, - self.value4, - self.value5, - self.value6, - self.value7, - self.value8, - self.value9, - self.value10, - self.value11, - self.value12, - self.value13, - self.value14, - self.value15, - self.value16, - self.value17, - self.value18, - self.value19, - self.value20, - self.value21, - self.value22 - ], - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - try self.value1?.encode(to: encoder) - try self.value2?.encode(to: encoder) - try self.value3?.encode(to: encoder) - try self.value4?.encode(to: encoder) - try self.value5?.encode(to: encoder) - try self.value6?.encode(to: encoder) - try self.value7?.encode(to: encoder) - try self.value8?.encode(to: encoder) - try self.value9?.encode(to: encoder) - try self.value10?.encode(to: encoder) - try self.value11?.encode(to: encoder) - try self.value12?.encode(to: encoder) - try self.value13?.encode(to: encoder) - try self.value14?.encode(to: encoder) - try self.value15?.encode(to: encoder) - try self.value16?.encode(to: encoder) - try self.value17?.encode(to: encoder) - try self.value18?.encode(to: encoder) - try self.value19?.encode(to: encoder) - try self.value20?.encode(to: encoder) - try self.value21?.encode(to: encoder) - try self.value22?.encode(to: encoder) + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case actor + case event + case commitId = "commit_id" + case commitUrl = "commit_url" + case createdAt = "created_at" + case performedViaGithubApp = "performed_via_github_app" + case blockedBy = "blocked_by" } } - /// Timeline Comment Event + /// Blocked-by Removed Issue Event /// - /// - Remark: Generated from `#/components/schemas/timeline-comment-event`. - public struct TimelineCommentEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/event`. - public var event: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/actor`. - public var actor: Components.Schemas.SimpleUser - /// Unique identifier of the issue comment - /// - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/id`. + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event`. + public struct BlockedByRemovedIssueEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/node_id`. + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/node_id`. public var nodeId: Swift.String - /// URL for the issue comment - /// - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/url`. + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/url`. public var url: Swift.String - /// Contents of the issue comment - /// - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/body_text`. - public var bodyText: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/body_html`. - public var bodyHtml: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/user`. - public var user: Components.Schemas.SimpleUser - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/issue_url`. - public var issueUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/performed_via_github_app`. + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/commit_url`. + public var commitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/created_at`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/performed_via_github_app`. public var performedViaGithubApp: Components.Schemas.NullableIntegration? - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/reactions`. - public var reactions: Components.Schemas.ReactionRollup? - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/pin`. - public var pin: Components.Schemas.NullablePinnedIssueComment? - /// - Remark: Generated from `#/components/schemas/timeline-comment-event/minimized`. - public var minimized: Components.Schemas.NullableIssueCommentMinimized? - /// Creates a new `TimelineCommentEvent`. + /// - Remark: Generated from `#/components/schemas/blocked-by-removed-issue-event/blocked_by`. + public var blockedBy: Components.Schemas.NullableIssueReference? + /// Creates a new `BlockedByRemovedIssueEvent`. /// /// - Parameters: - /// - event: - /// - actor: - /// - id: Unique identifier of the issue comment + /// - id: /// - nodeId: - /// - url: URL for the issue comment - /// - body: Contents of the issue comment - /// - bodyText: - /// - bodyHtml: - /// - htmlUrl: - /// - user: + /// - url: + /// - actor: + /// - event: + /// - commitId: + /// - commitUrl: /// - createdAt: - /// - updatedAt: - /// - issueUrl: - /// - authorAssociation: /// - performedViaGithubApp: - /// - reactions: - /// - pin: - /// - minimized: + /// - blockedBy: public init( - event: Swift.String, - actor: Components.Schemas.SimpleUser, id: Swift.Int, nodeId: Swift.String, url: Swift.String, - body: Swift.String? = nil, - bodyText: Swift.String? = nil, - bodyHtml: Swift.String? = nil, - htmlUrl: Swift.String, - user: Components.Schemas.SimpleUser, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - issueUrl: Swift.String, - authorAssociation: Components.Schemas.AuthorAssociation, + actor: Components.Schemas.SimpleUser, + event: Swift.String, + commitId: Swift.String? = nil, + commitUrl: Swift.String? = nil, + createdAt: Swift.String, performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - reactions: Components.Schemas.ReactionRollup? = nil, - pin: Components.Schemas.NullablePinnedIssueComment? = nil, - minimized: Components.Schemas.NullableIssueCommentMinimized? = nil + blockedBy: Components.Schemas.NullableIssueReference? = nil ) { - self.event = event - self.actor = actor self.id = id self.nodeId = nodeId self.url = url - self.body = body - self.bodyText = bodyText - self.bodyHtml = bodyHtml - self.htmlUrl = htmlUrl - self.user = user + self.actor = actor + self.event = event + self.commitId = commitId + self.commitUrl = commitUrl self.createdAt = createdAt - self.updatedAt = updatedAt - self.issueUrl = issueUrl - self.authorAssociation = authorAssociation self.performedViaGithubApp = performedViaGithubApp - self.reactions = reactions - self.pin = pin - self.minimized = minimized + self.blockedBy = blockedBy } public enum CodingKeys: String, CodingKey { - case event - case actor case id case nodeId = "node_id" case url - case body - case bodyText = "body_text" - case bodyHtml = "body_html" - case htmlUrl = "html_url" - case user + case actor + case event + case commitId = "commit_id" + case commitUrl = "commit_url" case createdAt = "created_at" - case updatedAt = "updated_at" - case issueUrl = "issue_url" - case authorAssociation = "author_association" case performedViaGithubApp = "performed_via_github_app" - case reactions - case pin - case minimized + case blockedBy = "blocked_by" } } - /// Timeline Cross Referenced Event + /// Blocking Added Issue Event /// - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event`. - public struct TimelineCrossReferencedEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/event`. + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event`. + public struct BlockingAddedIssueEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/event`. public var event: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/actor`. - public var actor: Components.Schemas.SimpleUser? - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source`. - public struct SourcePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source/type`. - public var _type: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source/issue`. - public var issue: Components.Schemas.Issue? - /// Creates a new `SourcePayload`. - /// - /// - Parameters: - /// - _type: - /// - issue: - public init( - _type: Swift.String? = nil, - issue: Components.Schemas.Issue? = nil - ) { - self._type = _type - self.issue = issue - } - public enum CodingKeys: String, CodingKey { - case _type = "type" - case issue - } - } - /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source`. - public var source: Components.Schemas.TimelineCrossReferencedEvent.SourcePayload - /// Creates a new `TimelineCrossReferencedEvent`. + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/commit_url`. + public var commitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/created_at`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/blocking-added-issue-event/blocking`. + public var blocking: Components.Schemas.NullableIssueReference? + /// Creates a new `BlockingAddedIssueEvent`. /// /// - Parameters: - /// - event: + /// - id: + /// - nodeId: + /// - url: /// - actor: + /// - event: + /// - commitId: + /// - commitUrl: /// - createdAt: - /// - updatedAt: - /// - source: + /// - performedViaGithubApp: + /// - blocking: public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + actor: Components.Schemas.SimpleUser, event: Swift.String, - actor: Components.Schemas.SimpleUser? = nil, - createdAt: Foundation.Date, - updatedAt: Foundation.Date, - source: Components.Schemas.TimelineCrossReferencedEvent.SourcePayload + commitId: Swift.String? = nil, + commitUrl: Swift.String? = nil, + createdAt: Swift.String, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + blocking: Components.Schemas.NullableIssueReference? = nil ) { - self.event = event + self.id = id + self.nodeId = nodeId + self.url = url self.actor = actor + self.event = event + self.commitId = commitId + self.commitUrl = commitUrl self.createdAt = createdAt - self.updatedAt = updatedAt - self.source = source + self.performedViaGithubApp = performedViaGithubApp + self.blocking = blocking } public enum CodingKeys: String, CodingKey { - case event + case id + case nodeId = "node_id" + case url case actor + case event + case commitId = "commit_id" + case commitUrl = "commit_url" case createdAt = "created_at" - case updatedAt = "updated_at" - case source + case performedViaGithubApp = "performed_via_github_app" + case blocking } } - /// Timeline Committed Event + /// Blocking Removed Issue Event /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event`. - public struct TimelineCommittedEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/event`. - public var event: Swift.String? - /// SHA for the commit - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/node_id`. + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event`. + public struct BlockingRemovedIssueEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/url`. + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/url`. public var url: Swift.String - /// Identifying information for the git-user - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author`. - public struct AuthorPayload: Codable, Hashable, Sendable { - /// Timestamp of the commit - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author/date`. - public var date: Foundation.Date - /// Git email address of the user - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author/email`. - public var email: Swift.String - /// Name of the git user - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author/name`. - public var name: Swift.String - /// Creates a new `AuthorPayload`. - /// - /// - Parameters: - /// - date: Timestamp of the commit - /// - email: Git email address of the user - /// - name: Name of the git user - public init( - date: Foundation.Date, - email: Swift.String, - name: Swift.String - ) { - self.date = date - self.email = email - self.name = name - } - public enum CodingKeys: String, CodingKey { - case date - case email - case name - } - } - /// Identifying information for the git-user - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author`. - public var author: Components.Schemas.TimelineCommittedEvent.AuthorPayload - /// Identifying information for the git-user + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/commit_url`. + public var commitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/created_at`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/blocking-removed-issue-event/blocking`. + public var blocking: Components.Schemas.NullableIssueReference? + /// Creates a new `BlockingRemovedIssueEvent`. /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer`. - public struct CommitterPayload: Codable, Hashable, Sendable { - /// Timestamp of the commit - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer/date`. - public var date: Foundation.Date - /// Git email address of the user - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer/email`. - public var email: Swift.String - /// Name of the git user - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer/name`. - public var name: Swift.String - /// Creates a new `CommitterPayload`. - /// - /// - Parameters: - /// - date: Timestamp of the commit - /// - email: Git email address of the user - /// - name: Name of the git user - public init( - date: Foundation.Date, - email: Swift.String, - name: Swift.String - ) { - self.date = date - self.email = email - self.name = name - } - public enum CodingKeys: String, CodingKey { - case date - case email - case name - } + /// - Parameters: + /// - id: + /// - nodeId: + /// - url: + /// - actor: + /// - event: + /// - commitId: + /// - commitUrl: + /// - createdAt: + /// - performedViaGithubApp: + /// - blocking: + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + actor: Components.Schemas.SimpleUser, + event: Swift.String, + commitId: Swift.String? = nil, + commitUrl: Swift.String? = nil, + createdAt: Swift.String, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + blocking: Components.Schemas.NullableIssueReference? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.actor = actor + self.event = event + self.commitId = commitId + self.commitUrl = commitUrl + self.createdAt = createdAt + self.performedViaGithubApp = performedViaGithubApp + self.blocking = blocking } - /// Identifying information for the git-user - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer`. - public var committer: Components.Schemas.TimelineCommittedEvent.CommitterPayload - /// Message describing the purpose of the commit - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/message`. - public var message: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree`. - public struct TreePayload: Codable, Hashable, Sendable { - /// SHA for the commit - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree/url`. - public var url: Swift.String - /// Creates a new `TreePayload`. - /// - /// - Parameters: - /// - sha: SHA for the commit - /// - url: - public init( - sha: Swift.String, - url: Swift.String - ) { - self.sha = sha - self.url = url - } - public enum CodingKeys: String, CodingKey { - case sha - case url - } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case actor + case event + case commitId = "commit_id" + case commitUrl = "commit_url" + case createdAt = "created_at" + case performedViaGithubApp = "performed_via_github_app" + case blocking } - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree`. - public var tree: Components.Schemas.TimelineCommittedEvent.TreePayload - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload`. - public struct ParentsPayloadPayload: Codable, Hashable, Sendable { - /// SHA for the commit - /// - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload/sha`. - public var sha: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload/html_url`. - public var htmlUrl: Swift.String - /// Creates a new `ParentsPayloadPayload`. - /// - /// - Parameters: - /// - sha: SHA for the commit - /// - url: - /// - htmlUrl: - public init( - sha: Swift.String, - url: Swift.String, - htmlUrl: Swift.String - ) { - self.sha = sha - self.url = url - self.htmlUrl = htmlUrl - } - public enum CodingKeys: String, CodingKey { - case sha - case url - case htmlUrl = "html_url" - } - } - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/parents`. - public typealias ParentsPayload = [Components.Schemas.TimelineCommittedEvent.ParentsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/parents`. - public var parents: Components.Schemas.TimelineCommittedEvent.ParentsPayload - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification`. - public struct VerificationPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/verified`. - public var verified: Swift.Bool - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/reason`. - public var reason: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/signature`. - 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 verifiedAt: Swift.String? - /// Creates a new `VerificationPayload`. - /// - /// - Parameters: - /// - verified: - /// - reason: - /// - signature: - /// - payload: - /// - verifiedAt: - public init( - verified: Swift.Bool, - reason: Swift.String, - signature: Swift.String? = nil, - payload: Swift.String? = nil, - verifiedAt: Swift.String? = nil - ) { - self.verified = verified - self.reason = reason - self.signature = signature - self.payload = payload - self.verifiedAt = verifiedAt - } - public enum CodingKeys: String, CodingKey { - case verified - case reason - case signature - case payload - case verifiedAt = "verified_at" - } - } - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification`. - public var verification: Components.Schemas.TimelineCommittedEvent.VerificationPayload - /// - Remark: Generated from `#/components/schemas/timeline-committed-event/html_url`. - public var htmlUrl: Swift.String - /// Creates a new `TimelineCommittedEvent`. + } + /// Issue Event for Issue + /// + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue`. + public struct IssueEventForIssue: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value1`. + public var value1: Components.Schemas.LabeledIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value2`. + public var value2: Components.Schemas.UnlabeledIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value3`. + public var value3: Components.Schemas.AssignedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value4`. + public var value4: Components.Schemas.UnassignedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value5`. + public var value5: Components.Schemas.MilestonedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value6`. + public var value6: Components.Schemas.DemilestonedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value7`. + public var value7: Components.Schemas.RenamedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value8`. + public var value8: Components.Schemas.ReviewRequestedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value9`. + public var value9: Components.Schemas.ReviewRequestRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value10`. + public var value10: Components.Schemas.ReviewDismissedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value11`. + public var value11: Components.Schemas.LockedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value12`. + public var value12: Components.Schemas.AddedToProjectIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value13`. + public var value13: Components.Schemas.MovedColumnInProjectIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value14`. + public var value14: Components.Schemas.RemovedFromProjectIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value15`. + public var value15: Components.Schemas.ConvertedNoteToIssueIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value16`. + public var value16: Components.Schemas.IssueTypeAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value17`. + public var value17: Components.Schemas.IssueTypeRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value18`. + public var value18: Components.Schemas.IssueTypeChangedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value19`. + public var value19: Components.Schemas.SubIssueAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value20`. + public var value20: Components.Schemas.SubIssueRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value21`. + public var value21: Components.Schemas.ParentIssueAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value22`. + public var value22: Components.Schemas.ParentIssueRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value23`. + public var value23: Components.Schemas.BlockedByAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value24`. + public var value24: Components.Schemas.BlockedByRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value25`. + public var value25: Components.Schemas.BlockingAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/issue-event-for-issue/value26`. + public var value26: Components.Schemas.BlockingRemovedIssueEvent? + /// Creates a new `IssueEventForIssue`. /// /// - Parameters: - /// - event: - /// - sha: SHA for the commit - /// - nodeId: - /// - url: - /// - author: Identifying information for the git-user - /// - committer: Identifying information for the git-user - /// - message: Message describing the purpose of the commit - /// - tree: - /// - parents: - /// - verification: - /// - htmlUrl: + /// - value1: + /// - value2: + /// - value3: + /// - value4: + /// - value5: + /// - value6: + /// - value7: + /// - value8: + /// - value9: + /// - value10: + /// - value11: + /// - value12: + /// - value13: + /// - value14: + /// - value15: + /// - value16: + /// - value17: + /// - value18: + /// - value19: + /// - value20: + /// - value21: + /// - value22: + /// - value23: + /// - value24: + /// - value25: + /// - value26: public init( - event: Swift.String? = nil, - sha: Swift.String, - nodeId: Swift.String, - url: Swift.String, - author: Components.Schemas.TimelineCommittedEvent.AuthorPayload, - committer: Components.Schemas.TimelineCommittedEvent.CommitterPayload, - message: Swift.String, - tree: Components.Schemas.TimelineCommittedEvent.TreePayload, - parents: Components.Schemas.TimelineCommittedEvent.ParentsPayload, - verification: Components.Schemas.TimelineCommittedEvent.VerificationPayload, - htmlUrl: Swift.String + value1: Components.Schemas.LabeledIssueEvent? = nil, + value2: Components.Schemas.UnlabeledIssueEvent? = nil, + value3: Components.Schemas.AssignedIssueEvent? = nil, + value4: Components.Schemas.UnassignedIssueEvent? = nil, + value5: Components.Schemas.MilestonedIssueEvent? = nil, + value6: Components.Schemas.DemilestonedIssueEvent? = nil, + value7: Components.Schemas.RenamedIssueEvent? = nil, + value8: Components.Schemas.ReviewRequestedIssueEvent? = nil, + value9: Components.Schemas.ReviewRequestRemovedIssueEvent? = nil, + value10: Components.Schemas.ReviewDismissedIssueEvent? = nil, + value11: Components.Schemas.LockedIssueEvent? = nil, + value12: Components.Schemas.AddedToProjectIssueEvent? = nil, + value13: Components.Schemas.MovedColumnInProjectIssueEvent? = nil, + value14: Components.Schemas.RemovedFromProjectIssueEvent? = nil, + value15: Components.Schemas.ConvertedNoteToIssueIssueEvent? = nil, + value16: Components.Schemas.IssueTypeAddedIssueEvent? = nil, + value17: Components.Schemas.IssueTypeRemovedIssueEvent? = nil, + value18: Components.Schemas.IssueTypeChangedIssueEvent? = nil, + value19: Components.Schemas.SubIssueAddedIssueEvent? = nil, + value20: Components.Schemas.SubIssueRemovedIssueEvent? = nil, + value21: Components.Schemas.ParentIssueAddedIssueEvent? = nil, + value22: Components.Schemas.ParentIssueRemovedIssueEvent? = nil, + value23: Components.Schemas.BlockedByAddedIssueEvent? = nil, + value24: Components.Schemas.BlockedByRemovedIssueEvent? = nil, + value25: Components.Schemas.BlockingAddedIssueEvent? = nil, + value26: Components.Schemas.BlockingRemovedIssueEvent? = nil ) { - self.event = event - self.sha = sha - self.nodeId = nodeId - self.url = url - self.author = author - self.committer = committer - self.message = message - self.tree = tree - self.parents = parents - self.verification = verification - self.htmlUrl = htmlUrl - } - public enum CodingKeys: String, CodingKey { - case event - case sha - case nodeId = "node_id" - case url - case author - case committer - case message - case tree - case parents - case verification - case htmlUrl = "html_url" + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + self.value4 = value4 + self.value5 = value5 + self.value6 = value6 + self.value7 = value7 + self.value8 = value8 + self.value9 = value9 + self.value10 = value10 + self.value11 = value11 + self.value12 = value12 + self.value13 = value13 + self.value14 = value14 + self.value15 = value15 + self.value16 = value16 + self.value17 = value17 + self.value18 = value18 + self.value19 = value19 + self.value20 = value20 + self.value21 = value21 + self.value22 = value22 + self.value23 = value23 + self.value24 = value24 + self.value25 = value25 + self.value26 = value26 } - } - /// Timeline Reviewed Event - /// - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event`. - public struct TimelineReviewedEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/event`. - public var event: Swift.String - /// Unique identifier of the review - /// - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/user`. - public var user: Components.Schemas.SimpleUser - /// The text of the review. - /// - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/body`. - public var body: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/state`. - public var state: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/pull_request_url`. - public var pullRequestUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/html`. - public struct HtmlPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/html/href`. - public var href: Swift.String - /// Creates a new `HtmlPayload`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) } - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/html`. - public var html: Components.Schemas.TimelineReviewedEvent._LinksPayload.HtmlPayload - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/pull_request`. - public struct PullRequestPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/pull_request/href`. - public var href: Swift.String - /// Creates a new `PullRequestPayload`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) } - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/pull_request`. - public var pullRequest: Components.Schemas.TimelineReviewedEvent._LinksPayload.PullRequestPayload - /// Creates a new `_LinksPayload`. - /// - /// - Parameters: - /// - html: - /// - pullRequest: - public init( - html: Components.Schemas.TimelineReviewedEvent._LinksPayload.HtmlPayload, - pullRequest: Components.Schemas.TimelineReviewedEvent._LinksPayload.PullRequestPayload - ) { - self.html = html - self.pullRequest = pullRequest + do { + self.value3 = try .init(from: decoder) + } catch { + errors.append(error) } - public enum CodingKeys: String, CodingKey { - case html - case pullRequest = "pull_request" + do { + self.value4 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value5 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value6 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value7 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value8 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value9 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value10 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value11 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value12 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value13 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value14 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value15 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value16 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value17 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value18 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value19 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value20 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value21 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value22 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value23 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value24 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value25 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value26 = try .init(from: decoder) + } catch { + errors.append(error) } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3, + self.value4, + self.value5, + self.value6, + self.value7, + self.value8, + self.value9, + self.value10, + self.value11, + self.value12, + self.value13, + self.value14, + self.value15, + self.value16, + self.value17, + self.value18, + self.value19, + self.value20, + self.value21, + self.value22, + self.value23, + self.value24, + self.value25, + self.value26 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links`. - public var _links: Components.Schemas.TimelineReviewedEvent._LinksPayload - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/submitted_at`. - public var submittedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/updated_at`. - public var updatedAt: Foundation.Date? - /// A commit SHA for the review. - /// - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/commit_id`. - public var commitId: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/body_html`. - public var bodyHtml: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/body_text`. - public var bodyText: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// Creates a new `TimelineReviewedEvent`. - /// - /// - Parameters: - /// - event: - /// - id: Unique identifier of the review - /// - nodeId: - /// - user: - /// - body: The text of the review. - /// - state: - /// - htmlUrl: - /// - pullRequestUrl: - /// - _links: - /// - submittedAt: - /// - updatedAt: - /// - commitId: A commit SHA for the review. - /// - bodyHtml: + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + try self.value3?.encode(to: encoder) + try self.value4?.encode(to: encoder) + try self.value5?.encode(to: encoder) + try self.value6?.encode(to: encoder) + try self.value7?.encode(to: encoder) + try self.value8?.encode(to: encoder) + try self.value9?.encode(to: encoder) + try self.value10?.encode(to: encoder) + try self.value11?.encode(to: encoder) + try self.value12?.encode(to: encoder) + try self.value13?.encode(to: encoder) + try self.value14?.encode(to: encoder) + try self.value15?.encode(to: encoder) + try self.value16?.encode(to: encoder) + try self.value17?.encode(to: encoder) + try self.value18?.encode(to: encoder) + try self.value19?.encode(to: encoder) + try self.value20?.encode(to: encoder) + try self.value21?.encode(to: encoder) + try self.value22?.encode(to: encoder) + try self.value23?.encode(to: encoder) + try self.value24?.encode(to: encoder) + try self.value25?.encode(to: encoder) + try self.value26?.encode(to: encoder) + } + } + /// An agent-proposed change to an issue that a maintainer can approve or dismiss. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion`. + public struct IssueSuggestion: Codable, Hashable, Sendable { + /// The unique identifier of the suggestion. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/id`. + public var id: Swift.Int + /// The unique identifier of the issue the suggestion applies to. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/issue_id`. + public var issueId: Swift.Int + /// The kind of change proposed. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/action`. + @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case setType = "set_type" + case addLabel = "add_label" + case addField = "add_field" + case addAssignee = "add_assignee" + case closeIssue = "close_issue" + } + /// The kind of change proposed. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/action`. + public var action: Components.Schemas.IssueSuggestion.ActionPayload + /// The suggestion's lifecycle state. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pending = "pending" + case applied = "applied" + case approved = "approved" + case dismissed = "dismissed" + case replaced = "replaced" + case invalidated = "invalidated" + } + /// The suggestion's lifecycle state. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/state`. + public var state: Components.Schemas.IssueSuggestion.StatePayload + /// The identifier of the target the change applies to (issue type, label, field, assignee, or duplicate issue), when applicable. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/target_id`. + public var targetId: Swift.Int? + /// The proposed value, when applicable. An array for multi-select field suggestions. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/target_value`. + @frozen public enum TargetValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/issue-suggestion/target_value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/components/schemas/issue-suggestion/target_value/case2`. + case case2(Swift.Double) + /// - Remark: Generated from `#/components/schemas/issue-suggestion/target_value/case3`. + case case3(Swift.Bool) + /// - Remark: Generated from `#/components/schemas/issue-suggestion/target_value/case4`. + case case4([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case4(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + case let .case4(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The proposed value, when applicable. An array for multi-select field suggestions. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/target_value`. + public var targetValue: Components.Schemas.IssueSuggestion.TargetValuePayload? + /// The rationale the actor provided for the suggestion. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/rationale`. + public var rationale: Swift.String? + /// The actor's confidence level in the suggestion. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "LOW" + case medium = "MEDIUM" + case high = "HIGH" + } + /// The actor's confidence level in the suggestion. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/confidence`. + public var confidence: Components.Schemas.IssueSuggestion.ConfidencePayload? + /// The unique identifier of the actor that proposed the suggestion. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/actor_id`. + public var actorId: Swift.Int? + /// The identifier of the timeline event created when the suggestion was approved, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/issue_event_id`. + public var issueEventId: Swift.Int? + /// The unique identifier of the user who approved or dismissed the suggestion. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/resolved_by`. + public var resolvedBy: Swift.Int? + /// The time the suggestion was created. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/created_at`. + public var createdAt: Foundation.Date + /// The time the suggestion was last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-suggestion/updated_at`. + public var updatedAt: Foundation.Date + /// Creates a new `IssueSuggestion`. + /// + /// - Parameters: + /// - id: The unique identifier of the suggestion. + /// - issueId: The unique identifier of the issue the suggestion applies to. + /// - action: The kind of change proposed. + /// - state: The suggestion's lifecycle state. + /// - targetId: The identifier of the target the change applies to (issue type, label, field, assignee, or duplicate issue), when applicable. + /// - targetValue: The proposed value, when applicable. An array for multi-select field suggestions. + /// - rationale: The rationale the actor provided for the suggestion. + /// - confidence: The actor's confidence level in the suggestion. + /// - actorId: The unique identifier of the actor that proposed the suggestion. + /// - issueEventId: The identifier of the timeline event created when the suggestion was approved, when applicable. + /// - resolvedBy: The unique identifier of the user who approved or dismissed the suggestion. + /// - createdAt: The time the suggestion was created. + /// - updatedAt: The time the suggestion was last updated. + public init( + id: Swift.Int, + issueId: Swift.Int, + action: Components.Schemas.IssueSuggestion.ActionPayload, + state: Components.Schemas.IssueSuggestion.StatePayload, + targetId: Swift.Int? = nil, + targetValue: Components.Schemas.IssueSuggestion.TargetValuePayload? = nil, + rationale: Swift.String? = nil, + confidence: Components.Schemas.IssueSuggestion.ConfidencePayload? = nil, + actorId: Swift.Int? = nil, + issueEventId: Swift.Int? = nil, + resolvedBy: Swift.Int? = nil, + createdAt: Foundation.Date, + updatedAt: Foundation.Date + ) { + self.id = id + self.issueId = issueId + self.action = action + self.state = state + self.targetId = targetId + self.targetValue = targetValue + self.rationale = rationale + self.confidence = confidence + self.actorId = actorId + self.issueEventId = issueEventId + self.resolvedBy = resolvedBy + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case issueId = "issue_id" + case action + case state + case targetId = "target_id" + case targetValue = "target_value" + case rationale + case confidence + case actorId = "actor_id" + case issueEventId = "issue_event_id" + case resolvedBy = "resolved_by" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// Timeline Comment Event + /// + /// - Remark: Generated from `#/components/schemas/timeline-comment-event`. + public struct TimelineCommentEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// Unique identifier of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/node_id`. + public var nodeId: Swift.String + /// URL for the issue comment + /// + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/url`. + public var url: Swift.String + /// Contents of the issue comment + /// + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/user`. + public var user: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/issue_url`. + public var issueUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/pin`. + public var pin: Components.Schemas.NullablePinnedIssueComment? + /// - Remark: Generated from `#/components/schemas/timeline-comment-event/minimized`. + public var minimized: Components.Schemas.NullableIssueCommentMinimized? + /// Creates a new `TimelineCommentEvent`. + /// + /// - Parameters: + /// - event: + /// - actor: + /// - id: Unique identifier of the issue comment + /// - nodeId: + /// - url: URL for the issue comment + /// - body: Contents of the issue comment /// - bodyText: + /// - bodyHtml: + /// - htmlUrl: + /// - user: + /// - createdAt: + /// - updatedAt: + /// - issueUrl: /// - authorAssociation: + /// - performedViaGithubApp: + /// - reactions: + /// - pin: + /// - minimized: public init( event: Swift.String, + actor: Components.Schemas.SimpleUser, id: Swift.Int, nodeId: Swift.String, - user: Components.Schemas.SimpleUser, + url: Swift.String, body: Swift.String? = nil, - state: Swift.String, - htmlUrl: Swift.String, - pullRequestUrl: Swift.String, - _links: Components.Schemas.TimelineReviewedEvent._LinksPayload, - submittedAt: Foundation.Date? = nil, - updatedAt: Foundation.Date? = nil, - commitId: Swift.String, - bodyHtml: Swift.String? = nil, bodyText: Swift.String? = nil, - authorAssociation: Components.Schemas.AuthorAssociation + bodyHtml: Swift.String? = nil, + htmlUrl: Swift.String, + user: Components.Schemas.SimpleUser, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + issueUrl: Swift.String, + authorAssociation: Components.Schemas.AuthorAssociation, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + pin: Components.Schemas.NullablePinnedIssueComment? = nil, + minimized: Components.Schemas.NullableIssueCommentMinimized? = nil ) { self.event = event + self.actor = actor self.id = id self.nodeId = nodeId - self.user = user + self.url = url self.body = body - self.state = state + self.bodyText = bodyText + self.bodyHtml = bodyHtml self.htmlUrl = htmlUrl - self.pullRequestUrl = pullRequestUrl - self._links = _links - self.submittedAt = submittedAt + self.user = user + self.createdAt = createdAt self.updatedAt = updatedAt - self.commitId = commitId - self.bodyHtml = bodyHtml - self.bodyText = bodyText + self.issueUrl = issueUrl self.authorAssociation = authorAssociation + self.performedViaGithubApp = performedViaGithubApp + self.reactions = reactions + self.pin = pin + self.minimized = minimized } public enum CodingKeys: String, CodingKey { case event + case actor case id case nodeId = "node_id" - case user + case url case body - case state + case bodyText = "body_text" + case bodyHtml = "body_html" case htmlUrl = "html_url" - case pullRequestUrl = "pull_request_url" - case _links - case submittedAt = "submitted_at" + case user + case createdAt = "created_at" case updatedAt = "updated_at" - case commitId = "commit_id" - case bodyHtml = "body_html" - case bodyText = "body_text" + case issueUrl = "issue_url" case authorAssociation = "author_association" + case performedViaGithubApp = "performed_via_github_app" + case reactions + case pin + case minimized } } - /// Pull Request Review Comments are comments on a portion of the Pull Request's diff. + /// Timeline Cross Referenced Event /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment`. - public struct PullRequestReviewComment: Codable, Hashable, Sendable { - /// URL for the pull request review comment - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/url`. - public var url: Swift.String - /// The ID of the pull request review to which the comment belongs. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/pull_request_review_id`. - public var pullRequestReviewId: Swift.Int64? - /// The ID of the pull request review comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/id`. - public var id: Swift.Int64 - /// The node ID of the pull request review comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/node_id`. - public var nodeId: Swift.String - /// The diff of the line that the comment refers to. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/diff_hunk`. - public var diffHunk: Swift.String - /// The relative path of the file to which the comment applies. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/path`. - public var path: Swift.String - /// The line index in the diff to which the comment applies. This field is closing down; use `line` instead. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/position`. - public var position: Swift.Int? - /// The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_position`. - public var originalPosition: Swift.Int? - /// The SHA of the commit to which the comment applies. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/commit_id`. - public var commitId: Swift.String - /// The SHA of the original commit to which the comment applies. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_commit_id`. - public var originalCommitId: Swift.String - /// The comment ID to reply to. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/in_reply_to_id`. - public var inReplyToId: Swift.Int? - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/user`. - public var user: Components.Schemas.NullableSimpleUser? - /// The text of the comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body`. - public var body: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/created_at`. + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event`. + public struct TimelineCrossReferencedEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/actor`. + public var actor: Components.Schemas.SimpleUser? + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/created_at`. public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/updated_at`. + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/updated_at`. public var updatedAt: Foundation.Date - /// HTML URL for the pull request review comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/html_url`. - public var htmlUrl: Swift.String - /// URL for the pull request that the review comment belongs to. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/pull_request_url`. - public var pullRequestUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/author_association`. - public var authorAssociation: Components.Schemas.AuthorAssociation - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links`. - public struct _LinksPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/self`. - public struct _SelfPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/self/href`. - public var href: Swift.String - /// Creates a new `_SelfPayload`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/self`. - public var _self: Components.Schemas.PullRequestReviewComment._LinksPayload._SelfPayload - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/html`. - public struct HtmlPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/html/href`. - public var href: Swift.String - /// Creates a new `HtmlPayload`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/html`. - public var html: Components.Schemas.PullRequestReviewComment._LinksPayload.HtmlPayload - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/pull_request`. - public struct PullRequestPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/pull_request/href`. - public var href: Swift.String - /// Creates a new `PullRequestPayload`. - /// - /// - Parameters: - /// - href: - public init(href: Swift.String) { - self.href = href - } - public enum CodingKeys: String, CodingKey { - case href - } - } - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/pull_request`. - public var pullRequest: Components.Schemas.PullRequestReviewComment._LinksPayload.PullRequestPayload - /// Creates a new `_LinksPayload`. + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source`. + public struct SourcePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source/type`. + public var _type: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source/issue`. + public var issue: Components.Schemas.Issue? + /// Creates a new `SourcePayload`. /// /// - Parameters: - /// - _self: - /// - html: - /// - pullRequest: + /// - _type: + /// - issue: public init( - _self: Components.Schemas.PullRequestReviewComment._LinksPayload._SelfPayload, - html: Components.Schemas.PullRequestReviewComment._LinksPayload.HtmlPayload, - pullRequest: Components.Schemas.PullRequestReviewComment._LinksPayload.PullRequestPayload + _type: Swift.String? = nil, + issue: Components.Schemas.Issue? = nil ) { - self._self = _self - self.html = html - self.pullRequest = pullRequest + self._type = _type + self.issue = issue } public enum CodingKeys: String, CodingKey { - case _self = "self" - case html - case pullRequest = "pull_request" + case _type = "type" + case issue } } - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links`. - public var _links: Components.Schemas.PullRequestReviewComment._LinksPayload - /// The first line of the range for a multi-line comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/start_line`. - public var startLine: Swift.Int? - /// The first line of the range for a multi-line comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_start_line`. - public var originalStartLine: Swift.Int? - /// The side of the first line of the range for a multi-line comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/start_side`. - @frozen public enum StartSidePayload: String, Codable, Hashable, Sendable, CaseIterable { - case left = "LEFT" - case right = "RIGHT" - } - /// The side of the first line of the range for a multi-line comment. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/start_side`. - public var startSide: Components.Schemas.PullRequestReviewComment.StartSidePayload? - /// The line of the blob to which the comment applies. The last line of the range for a multi-line comment - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/line`. - public var line: Swift.Int? - /// The line of the blob to which the comment applies. The last line of the range for a multi-line comment - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_line`. - public var originalLine: Swift.Int? - /// The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/side`. - @frozen public enum SidePayload: String, Codable, Hashable, Sendable, CaseIterable { - case left = "LEFT" - case right = "RIGHT" - } - /// The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/side`. - public var side: Components.Schemas.PullRequestReviewComment.SidePayload? - /// The level at which the comment is targeted, can be a diff line or a file. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/subject_type`. - @frozen public enum SubjectTypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case line = "line" - case file = "file" - } - /// The level at which the comment is targeted, can be a diff line or a file. - /// - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/subject_type`. - public var subjectType: Components.Schemas.PullRequestReviewComment.SubjectTypePayload? - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/reactions`. - public var reactions: Components.Schemas.ReactionRollup? - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body_html`. - public var bodyHtml: Swift.String? - /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body_text`. - public var bodyText: Swift.String? - /// Creates a new `PullRequestReviewComment`. + /// - Remark: Generated from `#/components/schemas/timeline-cross-referenced-event/source`. + public var source: Components.Schemas.TimelineCrossReferencedEvent.SourcePayload + /// Creates a new `TimelineCrossReferencedEvent`. /// /// - Parameters: - /// - url: URL for the pull request review comment - /// - pullRequestReviewId: The ID of the pull request review to which the comment belongs. - /// - id: The ID of the pull request review comment. - /// - nodeId: The node ID of the pull request review comment. - /// - diffHunk: The diff of the line that the comment refers to. - /// - path: The relative path of the file to which the comment applies. - /// - position: The line index in the diff to which the comment applies. This field is closing down; use `line` instead. - /// - originalPosition: The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. - /// - commitId: The SHA of the commit to which the comment applies. - /// - originalCommitId: The SHA of the original commit to which the comment applies. - /// - inReplyToId: The comment ID to reply to. - /// - user: - /// - body: The text of the comment. + /// - event: + /// - actor: /// - createdAt: /// - updatedAt: - /// - htmlUrl: HTML URL for the pull request review comment. - /// - pullRequestUrl: URL for the pull request that the review comment belongs to. - /// - authorAssociation: - /// - _links: - /// - startLine: The first line of the range for a multi-line comment. - /// - originalStartLine: The first line of the range for a multi-line comment. - /// - startSide: The side of the first line of the range for a multi-line comment. - /// - line: The line of the blob to which the comment applies. The last line of the range for a multi-line comment - /// - originalLine: The line of the blob to which the comment applies. The last line of the range for a multi-line comment - /// - side: The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment - /// - subjectType: The level at which the comment is targeted, can be a diff line or a file. - /// - reactions: - /// - bodyHtml: - /// - bodyText: + /// - source: public init( - url: Swift.String, - pullRequestReviewId: Swift.Int64? = nil, - id: Swift.Int64, - nodeId: Swift.String, - diffHunk: Swift.String, - path: Swift.String, - position: Swift.Int? = nil, - originalPosition: Swift.Int? = nil, - commitId: Swift.String, - originalCommitId: Swift.String, - inReplyToId: Swift.Int? = nil, - user: Components.Schemas.NullableSimpleUser? = nil, - body: Swift.String, + event: Swift.String, + actor: Components.Schemas.SimpleUser? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date, - htmlUrl: Swift.String, - pullRequestUrl: Swift.String, - authorAssociation: Components.Schemas.AuthorAssociation, - _links: Components.Schemas.PullRequestReviewComment._LinksPayload, - startLine: Swift.Int? = nil, - originalStartLine: Swift.Int? = nil, - startSide: Components.Schemas.PullRequestReviewComment.StartSidePayload? = nil, - line: Swift.Int? = nil, - originalLine: Swift.Int? = nil, - side: Components.Schemas.PullRequestReviewComment.SidePayload? = nil, - subjectType: Components.Schemas.PullRequestReviewComment.SubjectTypePayload? = nil, - reactions: Components.Schemas.ReactionRollup? = nil, - bodyHtml: Swift.String? = nil, - bodyText: Swift.String? = nil + source: Components.Schemas.TimelineCrossReferencedEvent.SourcePayload ) { - self.url = url - self.pullRequestReviewId = pullRequestReviewId - self.id = id - self.nodeId = nodeId - self.diffHunk = diffHunk - self.path = path - self.position = position - self.originalPosition = originalPosition - self.commitId = commitId - self.originalCommitId = originalCommitId - self.inReplyToId = inReplyToId - self.user = user - self.body = body + self.event = event + self.actor = actor self.createdAt = createdAt self.updatedAt = updatedAt - self.htmlUrl = htmlUrl - self.pullRequestUrl = pullRequestUrl - self.authorAssociation = authorAssociation - self._links = _links - self.startLine = startLine - self.originalStartLine = originalStartLine - self.startSide = startSide - self.line = line - self.originalLine = originalLine - self.side = side - self.subjectType = subjectType - self.reactions = reactions - self.bodyHtml = bodyHtml - self.bodyText = bodyText + self.source = source } public enum CodingKeys: String, CodingKey { - case url - case pullRequestReviewId = "pull_request_review_id" - case id - case nodeId = "node_id" - case diffHunk = "diff_hunk" - case path - case position - case originalPosition = "original_position" - case commitId = "commit_id" - case originalCommitId = "original_commit_id" - case inReplyToId = "in_reply_to_id" - case user - case body + case event + case actor case createdAt = "created_at" case updatedAt = "updated_at" - case htmlUrl = "html_url" - case pullRequestUrl = "pull_request_url" - case authorAssociation = "author_association" - case _links - case startLine = "start_line" - case originalStartLine = "original_start_line" - case startSide = "start_side" - case line - case originalLine = "original_line" - case side - case subjectType = "subject_type" - case reactions - case bodyHtml = "body_html" - case bodyText = "body_text" - } - } - /// Timeline Line Commented Event - /// - /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event`. - public struct TimelineLineCommentedEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event/event`. - public var event: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event/comments`. - public var comments: [Components.Schemas.PullRequestReviewComment]? - /// Creates a new `TimelineLineCommentedEvent`. - /// - /// - Parameters: - /// - event: - /// - nodeId: - /// - comments: - public init( - event: Swift.String? = nil, - nodeId: Swift.String? = nil, - comments: [Components.Schemas.PullRequestReviewComment]? = nil - ) { - self.event = event - self.nodeId = nodeId - self.comments = comments - } - public enum CodingKeys: String, CodingKey { - case event - case nodeId = "node_id" - case comments + case source } } - /// Timeline Commit Commented Event + /// Timeline Committed Event /// - /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event`. - public struct TimelineCommitCommentedEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/event`. + /// - Remark: Generated from `#/components/schemas/timeline-committed-event`. + public struct TimelineCommittedEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/event`. public var event: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/node_id`. - public var nodeId: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/commit_id`. - public var commitId: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/comments`. - public var comments: [Components.Schemas.CommitComment]? - /// Creates a new `TimelineCommitCommentedEvent`. + /// SHA for the commit /// - /// - Parameters: - /// - event: - /// - nodeId: - /// - commitId: - /// - comments: - public init( - event: Swift.String? = nil, - nodeId: Swift.String? = nil, - commitId: Swift.String? = nil, - comments: [Components.Schemas.CommitComment]? = nil - ) { - self.event = event - self.nodeId = nodeId - self.commitId = commitId - self.comments = comments - } - public enum CodingKeys: String, CodingKey { - case event - case nodeId = "node_id" - case commitId = "commit_id" - case comments - } - } - /// Timeline Assigned Issue Event - /// - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event`. - public struct TimelineAssignedIssueEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/node_id`. + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/url`. + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/url`. public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/actor`. - public var actor: Components.Schemas.SimpleUser - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/event`. - public var event: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/commit_id`. - public var commitId: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/commit_url`. - public var commitUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/created_at`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/performed_via_github_app`. - public var performedViaGithubApp: Components.Schemas.NullableIntegration? - /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/assignee`. - public var assignee: Components.Schemas.SimpleUser - /// Creates a new `TimelineAssignedIssueEvent`. + /// Identifying information for the git-user /// - /// - Parameters: - /// - id: - /// - nodeId: - /// - url: - /// - actor: - /// - event: - /// - commitId: - /// - commitUrl: - /// - createdAt: - /// - performedViaGithubApp: - /// - assignee: - public init( - id: Swift.Int, - nodeId: Swift.String, - url: Swift.String, - actor: Components.Schemas.SimpleUser, - event: Swift.String, - commitId: Swift.String? = nil, - commitUrl: Swift.String? = nil, - createdAt: Swift.String, - performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - assignee: Components.Schemas.SimpleUser - ) { - self.id = id - self.nodeId = nodeId - self.url = url - self.actor = actor - self.event = event - self.commitId = commitId - self.commitUrl = commitUrl - self.createdAt = createdAt - self.performedViaGithubApp = performedViaGithubApp - self.assignee = assignee - } - public enum CodingKeys: String, CodingKey { - case id - case nodeId = "node_id" - case url - case actor - case event - case commitId = "commit_id" - case commitUrl = "commit_url" - case createdAt = "created_at" - case performedViaGithubApp = "performed_via_github_app" - case assignee + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author`. + public struct AuthorPayload: Codable, Hashable, Sendable { + /// Timestamp of the commit + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author/date`. + public var date: Foundation.Date + /// Git email address of the user + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author/email`. + public var email: Swift.String + /// Name of the git user + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author/name`. + public var name: Swift.String + /// Creates a new `AuthorPayload`. + /// + /// - Parameters: + /// - date: Timestamp of the commit + /// - email: Git email address of the user + /// - name: Name of the git user + public init( + date: Foundation.Date, + email: Swift.String, + name: Swift.String + ) { + self.date = date + self.email = email + self.name = name + } + public enum CodingKeys: String, CodingKey { + case date + case email + case name + } } - } - /// Timeline Unassigned Issue Event - /// - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event`. - public struct TimelineUnassignedIssueEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/node_id`. - public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/actor`. - public var actor: Components.Schemas.SimpleUser - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/event`. - public var event: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/commit_id`. - public var commitId: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/commit_url`. - public var commitUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/created_at`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/performed_via_github_app`. - public var performedViaGithubApp: Components.Schemas.NullableIntegration? - /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/assignee`. - public var assignee: Components.Schemas.SimpleUser - /// Creates a new `TimelineUnassignedIssueEvent`. + /// Identifying information for the git-user + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/author`. + public var author: Components.Schemas.TimelineCommittedEvent.AuthorPayload + /// Identifying information for the git-user + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer`. + public struct CommitterPayload: Codable, Hashable, Sendable { + /// Timestamp of the commit + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer/date`. + public var date: Foundation.Date + /// Git email address of the user + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer/email`. + public var email: Swift.String + /// Name of the git user + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer/name`. + public var name: Swift.String + /// Creates a new `CommitterPayload`. + /// + /// - Parameters: + /// - date: Timestamp of the commit + /// - email: Git email address of the user + /// - name: Name of the git user + public init( + date: Foundation.Date, + email: Swift.String, + name: Swift.String + ) { + self.date = date + self.email = email + self.name = name + } + public enum CodingKeys: String, CodingKey { + case date + case email + case name + } + } + /// Identifying information for the git-user + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/committer`. + public var committer: Components.Schemas.TimelineCommittedEvent.CommitterPayload + /// Message describing the purpose of the commit + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/message`. + public var message: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree`. + public struct TreePayload: Codable, Hashable, Sendable { + /// SHA for the commit + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree/url`. + public var url: Swift.String + /// Creates a new `TreePayload`. + /// + /// - Parameters: + /// - sha: SHA for the commit + /// - url: + public init( + sha: Swift.String, + url: Swift.String + ) { + self.sha = sha + self.url = url + } + public enum CodingKeys: String, CodingKey { + case sha + case url + } + } + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/tree`. + public var tree: Components.Schemas.TimelineCommittedEvent.TreePayload + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload`. + public struct ParentsPayloadPayload: Codable, Hashable, Sendable { + /// SHA for the commit + /// + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/ParentsPayload/html_url`. + public var htmlUrl: Swift.String + /// Creates a new `ParentsPayloadPayload`. + /// + /// - Parameters: + /// - sha: SHA for the commit + /// - url: + /// - htmlUrl: + public init( + sha: Swift.String, + url: Swift.String, + htmlUrl: Swift.String + ) { + self.sha = sha + self.url = url + self.htmlUrl = htmlUrl + } + public enum CodingKeys: String, CodingKey { + case sha + case url + case htmlUrl = "html_url" + } + } + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/parents`. + public typealias ParentsPayload = [Components.Schemas.TimelineCommittedEvent.ParentsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/parents`. + public var parents: Components.Schemas.TimelineCommittedEvent.ParentsPayload + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification`. + public struct VerificationPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/verified`. + public var verified: Swift.Bool + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/reason`. + public var reason: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification/signature`. + 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 verifiedAt: Swift.String? + /// Creates a new `VerificationPayload`. + /// + /// - Parameters: + /// - verified: + /// - reason: + /// - signature: + /// - payload: + /// - verifiedAt: + public init( + verified: Swift.Bool, + reason: Swift.String, + signature: Swift.String? = nil, + payload: Swift.String? = nil, + verifiedAt: Swift.String? = nil + ) { + self.verified = verified + self.reason = reason + self.signature = signature + self.payload = payload + self.verifiedAt = verifiedAt + } + public enum CodingKeys: String, CodingKey { + case verified + case reason + case signature + case payload + case verifiedAt = "verified_at" + } + } + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/verification`. + public var verification: Components.Schemas.TimelineCommittedEvent.VerificationPayload + /// - Remark: Generated from `#/components/schemas/timeline-committed-event/html_url`. + public var htmlUrl: Swift.String + /// Creates a new `TimelineCommittedEvent`. /// /// - Parameters: - /// - id: + /// - event: + /// - sha: SHA for the commit /// - nodeId: /// - url: - /// - actor: - /// - event: - /// - commitId: - /// - commitUrl: - /// - createdAt: - /// - performedViaGithubApp: - /// - assignee: + /// - author: Identifying information for the git-user + /// - committer: Identifying information for the git-user + /// - message: Message describing the purpose of the commit + /// - tree: + /// - parents: + /// - verification: + /// - htmlUrl: public init( - id: Swift.Int, + event: Swift.String? = nil, + sha: Swift.String, nodeId: Swift.String, url: Swift.String, - actor: Components.Schemas.SimpleUser, - event: Swift.String, - commitId: Swift.String? = nil, - commitUrl: Swift.String? = nil, - createdAt: Swift.String, - performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - assignee: Components.Schemas.SimpleUser + author: Components.Schemas.TimelineCommittedEvent.AuthorPayload, + committer: Components.Schemas.TimelineCommittedEvent.CommitterPayload, + message: Swift.String, + tree: Components.Schemas.TimelineCommittedEvent.TreePayload, + parents: Components.Schemas.TimelineCommittedEvent.ParentsPayload, + verification: Components.Schemas.TimelineCommittedEvent.VerificationPayload, + htmlUrl: Swift.String ) { - self.id = id + self.event = event + self.sha = sha self.nodeId = nodeId self.url = url - self.actor = actor - self.event = event - self.commitId = commitId - self.commitUrl = commitUrl - self.createdAt = createdAt - self.performedViaGithubApp = performedViaGithubApp - self.assignee = assignee + self.author = author + self.committer = committer + self.message = message + self.tree = tree + self.parents = parents + self.verification = verification + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { - case id + case event + case sha case nodeId = "node_id" case url - case actor - case event - case commitId = "commit_id" - case commitUrl = "commit_url" - case createdAt = "created_at" - case performedViaGithubApp = "performed_via_github_app" - case assignee + case author + case committer + case message + case tree + case parents + case verification + case htmlUrl = "html_url" } } - /// State Change Issue Event + /// Timeline Reviewed Event /// - /// - Remark: Generated from `#/components/schemas/state-change-issue-event`. - public struct StateChangeIssueEvent: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/id`. + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event`. + public struct TimelineReviewedEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/event`. + public var event: Swift.String + /// Unique identifier of the review + /// + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/id`. public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/node_id`. + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/node_id`. public var nodeId: Swift.String - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/actor`. - public var actor: Components.Schemas.SimpleUser - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/event`. - public var event: Swift.String - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/commit_id`. - public var commitId: Swift.String? - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/commit_url`. - public var commitUrl: Swift.String? - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/created_at`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/performed_via_github_app`. - public var performedViaGithubApp: Components.Schemas.NullableIntegration? - /// - Remark: Generated from `#/components/schemas/state-change-issue-event/state_reason`. - public var stateReason: Swift.String? - /// Creates a new `StateChangeIssueEvent`. + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/user`. + public var user: Components.Schemas.SimpleUser + /// The text of the review. + /// + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/body`. + public var body: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/state`. + public var state: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/pull_request_url`. + public var pullRequestUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/html`. + public struct HtmlPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/html/href`. + public var href: Swift.String + /// Creates a new `HtmlPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/html`. + public var html: Components.Schemas.TimelineReviewedEvent._LinksPayload.HtmlPayload + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/pull_request`. + public struct PullRequestPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/pull_request/href`. + public var href: Swift.String + /// Creates a new `PullRequestPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } + } + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links/pull_request`. + public var pullRequest: Components.Schemas.TimelineReviewedEvent._LinksPayload.PullRequestPayload + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - html: + /// - pullRequest: + public init( + html: Components.Schemas.TimelineReviewedEvent._LinksPayload.HtmlPayload, + pullRequest: Components.Schemas.TimelineReviewedEvent._LinksPayload.PullRequestPayload + ) { + self.html = html + self.pullRequest = pullRequest + } + public enum CodingKeys: String, CodingKey { + case html + case pullRequest = "pull_request" + } + } + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/_links`. + public var _links: Components.Schemas.TimelineReviewedEvent._LinksPayload + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/submitted_at`. + public var submittedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/updated_at`. + public var updatedAt: Foundation.Date? + /// A commit SHA for the review. + /// + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/commit_id`. + public var commitId: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/body_text`. + public var bodyText: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-reviewed-event/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// Creates a new `TimelineReviewedEvent`. /// /// - Parameters: - /// - id: - /// - nodeId: - /// - url: - /// - actor: /// - event: - /// - commitId: - /// - commitUrl: - /// - createdAt: - /// - performedViaGithubApp: - /// - stateReason: + /// - id: Unique identifier of the review + /// - nodeId: + /// - user: + /// - body: The text of the review. + /// - state: + /// - htmlUrl: + /// - pullRequestUrl: + /// - _links: + /// - submittedAt: + /// - updatedAt: + /// - commitId: A commit SHA for the review. + /// - bodyHtml: + /// - bodyText: + /// - authorAssociation: public init( + event: Swift.String, id: Swift.Int, nodeId: Swift.String, - url: Swift.String, - actor: Components.Schemas.SimpleUser, - event: Swift.String, - commitId: Swift.String? = nil, - commitUrl: Swift.String? = nil, - createdAt: Swift.String, - performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, - stateReason: Swift.String? = nil + user: Components.Schemas.SimpleUser, + body: Swift.String? = nil, + state: Swift.String, + htmlUrl: Swift.String, + pullRequestUrl: Swift.String, + _links: Components.Schemas.TimelineReviewedEvent._LinksPayload, + submittedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + commitId: Swift.String, + bodyHtml: Swift.String? = nil, + bodyText: Swift.String? = nil, + authorAssociation: Components.Schemas.AuthorAssociation ) { + self.event = event self.id = id self.nodeId = nodeId - self.url = url - self.actor = actor - self.event = event + self.user = user + self.body = body + self.state = state + self.htmlUrl = htmlUrl + self.pullRequestUrl = pullRequestUrl + self._links = _links + self.submittedAt = submittedAt + self.updatedAt = updatedAt self.commitId = commitId - self.commitUrl = commitUrl - self.createdAt = createdAt - self.performedViaGithubApp = performedViaGithubApp - self.stateReason = stateReason + self.bodyHtml = bodyHtml + self.bodyText = bodyText + self.authorAssociation = authorAssociation } public enum CodingKeys: String, CodingKey { + case event case id case nodeId = "node_id" - case url - case actor - case event + case user + case body + case state + case htmlUrl = "html_url" + case pullRequestUrl = "pull_request_url" + case _links + case submittedAt = "submitted_at" + case updatedAt = "updated_at" case commitId = "commit_id" - case commitUrl = "commit_url" - case createdAt = "created_at" - case performedViaGithubApp = "performed_via_github_app" - case stateReason = "state_reason" + case bodyHtml = "body_html" + case bodyText = "body_text" + case authorAssociation = "author_association" } } - /// Timeline Event + /// Pull Request Review Comments are comments on a portion of the Pull Request's diff. /// - /// - Remark: Generated from `#/components/schemas/timeline-issue-events`. - public struct TimelineIssueEvents: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value1`. - public var value1: Components.Schemas.LabeledIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value2`. - public var value2: Components.Schemas.UnlabeledIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value3`. - public var value3: Components.Schemas.MilestonedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value4`. - public var value4: Components.Schemas.DemilestonedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value5`. - public var value5: Components.Schemas.RenamedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value6`. - public var value6: Components.Schemas.ReviewRequestedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value7`. - public var value7: Components.Schemas.ReviewRequestRemovedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value8`. - public var value8: Components.Schemas.ReviewDismissedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value9`. - public var value9: Components.Schemas.LockedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value10`. - public var value10: Components.Schemas.AddedToProjectIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value11`. - public var value11: Components.Schemas.MovedColumnInProjectIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value12`. - public var value12: Components.Schemas.RemovedFromProjectIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value13`. - public var value13: Components.Schemas.ConvertedNoteToIssueIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value14`. - public var value14: Components.Schemas.TimelineCommentEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value15`. - public var value15: Components.Schemas.TimelineCrossReferencedEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value16`. - public var value16: Components.Schemas.TimelineCommittedEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value17`. - public var value17: Components.Schemas.TimelineReviewedEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value18`. - public var value18: Components.Schemas.TimelineLineCommentedEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value19`. - public var value19: Components.Schemas.TimelineCommitCommentedEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value20`. - public var value20: Components.Schemas.TimelineAssignedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value21`. - public var value21: Components.Schemas.TimelineUnassignedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value22`. - public var value22: Components.Schemas.StateChangeIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value23`. - public var value23: Components.Schemas.IssueTypeAddedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value24`. - public var value24: Components.Schemas.IssueTypeRemovedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value25`. - public var value25: Components.Schemas.IssueTypeChangedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value26`. - public var value26: Components.Schemas.SubIssueAddedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value27`. - public var value27: Components.Schemas.SubIssueRemovedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value28`. - public var value28: Components.Schemas.ParentIssueAddedIssueEvent? - /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value29`. - public var value29: Components.Schemas.ParentIssueRemovedIssueEvent? - /// Creates a new `TimelineIssueEvents`. + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment`. + public struct PullRequestReviewComment: Codable, Hashable, Sendable { + /// URL for the pull request review comment /// - /// - Parameters: - /// - value1: - /// - value2: - /// - value3: - /// - value4: - /// - value5: - /// - value6: - /// - value7: - /// - value8: - /// - value9: - /// - value10: - /// - value11: - /// - value12: - /// - value13: - /// - value14: - /// - value15: - /// - value16: - /// - value17: - /// - value18: - /// - value19: - /// - value20: - /// - value21: - /// - value22: - /// - value23: - /// - value24: - /// - value25: - /// - value26: - /// - value27: - /// - value28: - /// - value29: - public init( - value1: Components.Schemas.LabeledIssueEvent? = nil, - value2: Components.Schemas.UnlabeledIssueEvent? = nil, - value3: Components.Schemas.MilestonedIssueEvent? = nil, - value4: Components.Schemas.DemilestonedIssueEvent? = nil, - value5: Components.Schemas.RenamedIssueEvent? = nil, - value6: Components.Schemas.ReviewRequestedIssueEvent? = nil, - value7: Components.Schemas.ReviewRequestRemovedIssueEvent? = nil, - value8: Components.Schemas.ReviewDismissedIssueEvent? = nil, - value9: Components.Schemas.LockedIssueEvent? = nil, - value10: Components.Schemas.AddedToProjectIssueEvent? = nil, - value11: Components.Schemas.MovedColumnInProjectIssueEvent? = nil, - value12: Components.Schemas.RemovedFromProjectIssueEvent? = nil, - value13: Components.Schemas.ConvertedNoteToIssueIssueEvent? = nil, - value14: Components.Schemas.TimelineCommentEvent? = nil, - value15: Components.Schemas.TimelineCrossReferencedEvent? = nil, - value16: Components.Schemas.TimelineCommittedEvent? = nil, - value17: Components.Schemas.TimelineReviewedEvent? = nil, - value18: Components.Schemas.TimelineLineCommentedEvent? = nil, - value19: Components.Schemas.TimelineCommitCommentedEvent? = nil, - value20: Components.Schemas.TimelineAssignedIssueEvent? = nil, - value21: Components.Schemas.TimelineUnassignedIssueEvent? = nil, - value22: Components.Schemas.StateChangeIssueEvent? = nil, - value23: Components.Schemas.IssueTypeAddedIssueEvent? = nil, - value24: Components.Schemas.IssueTypeRemovedIssueEvent? = nil, - value25: Components.Schemas.IssueTypeChangedIssueEvent? = nil, - value26: Components.Schemas.SubIssueAddedIssueEvent? = nil, - value27: Components.Schemas.SubIssueRemovedIssueEvent? = nil, - value28: Components.Schemas.ParentIssueAddedIssueEvent? = nil, - value29: Components.Schemas.ParentIssueRemovedIssueEvent? = nil - ) { - self.value1 = value1 - self.value2 = value2 - self.value3 = value3 - self.value4 = value4 - self.value5 = value5 - self.value6 = value6 - self.value7 = value7 - self.value8 = value8 - self.value9 = value9 - self.value10 = value10 - self.value11 = value11 - self.value12 = value12 - self.value13 = value13 - self.value14 = value14 - self.value15 = value15 - self.value16 = value16 - self.value17 = value17 - self.value18 = value18 - self.value19 = value19 - self.value20 = value20 - self.value21 = value21 - self.value22 = value22 - self.value23 = value23 - self.value24 = value24 - self.value25 = value25 - self.value26 = value26 - self.value27 = value27 - self.value28 = value28 - self.value29 = value29 - } - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self.value1 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value2 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value3 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value4 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value5 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value6 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value7 = try .init(from: decoder) - } catch { - errors.append(error) + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/url`. + public var url: Swift.String + /// The ID of the pull request review to which the comment belongs. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/pull_request_review_id`. + public var pullRequestReviewId: Swift.Int64? + /// The ID of the pull request review comment. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/id`. + public var id: Swift.Int64 + /// The node ID of the pull request review comment. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/node_id`. + public var nodeId: Swift.String + /// The diff of the line that the comment refers to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/diff_hunk`. + public var diffHunk: Swift.String + /// The relative path of the file to which the comment applies. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/path`. + public var path: Swift.String + /// The line index in the diff to which the comment applies. This field is closing down; use `line` instead. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/position`. + public var position: Swift.Int? + /// The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_position`. + public var originalPosition: Swift.Int? + /// The SHA of the commit to which the comment applies. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/commit_id`. + public var commitId: Swift.String + /// The SHA of the original commit to which the comment applies. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_commit_id`. + public var originalCommitId: Swift.String + /// The comment ID to reply to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/in_reply_to_id`. + public var inReplyToId: Swift.Int? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// The text of the comment. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body`. + public var body: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/updated_at`. + public var updatedAt: Foundation.Date + /// HTML URL for the pull request review comment. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/html_url`. + public var htmlUrl: Swift.String + /// URL for the pull request that the review comment belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/pull_request_url`. + public var pullRequestUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/author_association`. + public var authorAssociation: Components.Schemas.AuthorAssociation + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links`. + public struct _LinksPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/self`. + public struct _SelfPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/self/href`. + public var href: Swift.String + /// Creates a new `_SelfPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } } - do { - self.value8 = try .init(from: decoder) - } catch { - errors.append(error) + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/self`. + public var _self: Components.Schemas.PullRequestReviewComment._LinksPayload._SelfPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/html`. + public struct HtmlPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/html/href`. + public var href: Swift.String + /// Creates a new `HtmlPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } } - do { - self.value9 = try .init(from: decoder) - } catch { - errors.append(error) + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/html`. + public var html: Components.Schemas.PullRequestReviewComment._LinksPayload.HtmlPayload + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/pull_request`. + public struct PullRequestPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/pull_request/href`. + public var href: Swift.String + /// Creates a new `PullRequestPayload`. + /// + /// - Parameters: + /// - href: + public init(href: Swift.String) { + self.href = href + } + public enum CodingKeys: String, CodingKey { + case href + } } - do { - self.value10 = try .init(from: decoder) - } catch { - errors.append(error) + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links/pull_request`. + public var pullRequest: Components.Schemas.PullRequestReviewComment._LinksPayload.PullRequestPayload + /// Creates a new `_LinksPayload`. + /// + /// - Parameters: + /// - _self: + /// - html: + /// - pullRequest: + public init( + _self: Components.Schemas.PullRequestReviewComment._LinksPayload._SelfPayload, + html: Components.Schemas.PullRequestReviewComment._LinksPayload.HtmlPayload, + pullRequest: Components.Schemas.PullRequestReviewComment._LinksPayload.PullRequestPayload + ) { + self._self = _self + self.html = html + self.pullRequest = pullRequest } - do { - self.value11 = try .init(from: decoder) - } catch { - errors.append(error) + public enum CodingKeys: String, CodingKey { + case _self = "self" + case html + case pullRequest = "pull_request" } - do { - self.value12 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value13 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value14 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value15 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value16 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value17 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value18 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value19 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value20 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value21 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value22 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value23 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value24 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value25 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value26 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value27 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value28 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value29 = try .init(from: decoder) - } catch { - errors.append(error) - } - try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( - [ - self.value1, - self.value2, - self.value3, - self.value4, - self.value5, - self.value6, - self.value7, - self.value8, - self.value9, - self.value10, - self.value11, - self.value12, - self.value13, - self.value14, - self.value15, - self.value16, - self.value17, - self.value18, - self.value19, - self.value20, - self.value21, - self.value22, - self.value23, - self.value24, - self.value25, - self.value26, - self.value27, - self.value28, - self.value29 - ], - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) } - public func encode(to encoder: any Swift.Encoder) throws { - try self.value1?.encode(to: encoder) - try self.value2?.encode(to: encoder) - try self.value3?.encode(to: encoder) - try self.value4?.encode(to: encoder) - try self.value5?.encode(to: encoder) - try self.value6?.encode(to: encoder) - try self.value7?.encode(to: encoder) - try self.value8?.encode(to: encoder) - try self.value9?.encode(to: encoder) - try self.value10?.encode(to: encoder) - try self.value11?.encode(to: encoder) - try self.value12?.encode(to: encoder) - try self.value13?.encode(to: encoder) - try self.value14?.encode(to: encoder) - try self.value15?.encode(to: encoder) - try self.value16?.encode(to: encoder) - try self.value17?.encode(to: encoder) - try self.value18?.encode(to: encoder) - try self.value19?.encode(to: encoder) - try self.value20?.encode(to: encoder) - try self.value21?.encode(to: encoder) - try self.value22?.encode(to: encoder) - try self.value23?.encode(to: encoder) - try self.value24?.encode(to: encoder) - try self.value25?.encode(to: encoder) - try self.value26?.encode(to: encoder) - try self.value27?.encode(to: encoder) - try self.value28?.encode(to: encoder) - try self.value29?.encode(to: encoder) + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/_links`. + public var _links: Components.Schemas.PullRequestReviewComment._LinksPayload + /// The first line of the range for a multi-line comment. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/start_line`. + public var startLine: Swift.Int? + /// The first line of the range for a multi-line comment. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_start_line`. + public var originalStartLine: Swift.Int? + /// The side of the first line of the range for a multi-line comment. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/start_side`. + @frozen public enum StartSidePayload: String, Codable, Hashable, Sendable, CaseIterable { + case left = "LEFT" + case right = "RIGHT" } - } - /// A collection of related issues and pull requests. - /// - /// - Remark: Generated from `#/components/schemas/milestone`. - public struct Milestone: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/milestone/url`. - public var url: Swift.String - /// - Remark: Generated from `#/components/schemas/milestone/html_url`. - public var htmlUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/milestone/labels_url`. - public var labelsUrl: Swift.String - /// - Remark: Generated from `#/components/schemas/milestone/id`. - public var id: Swift.Int - /// - Remark: Generated from `#/components/schemas/milestone/node_id`. - public var nodeId: Swift.String - /// The number of the milestone. + /// The side of the first line of the range for a multi-line comment. /// - /// - Remark: Generated from `#/components/schemas/milestone/number`. - public var number: Swift.Int - /// The state of the milestone. + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/start_side`. + public var startSide: Components.Schemas.PullRequestReviewComment.StartSidePayload? + /// The line of the blob to which the comment applies. The last line of the range for a multi-line comment /// - /// - Remark: Generated from `#/components/schemas/milestone/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/line`. + public var line: Swift.Int? + /// The line of the blob to which the comment applies. The last line of the range for a multi-line comment + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/original_line`. + public var originalLine: Swift.Int? + /// The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/side`. + @frozen public enum SidePayload: String, Codable, Hashable, Sendable, CaseIterable { + case left = "LEFT" + case right = "RIGHT" } - /// The state of the milestone. + /// The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment /// - /// - Remark: Generated from `#/components/schemas/milestone/state`. - public var state: Components.Schemas.Milestone.StatePayload - /// The title of the milestone. + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/side`. + public var side: Components.Schemas.PullRequestReviewComment.SidePayload? + /// The level at which the comment is targeted, can be a diff line or a file. /// - /// - Remark: Generated from `#/components/schemas/milestone/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/milestone/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/components/schemas/milestone/creator`. - public var creator: Components.Schemas.NullableSimpleUser? - /// - Remark: Generated from `#/components/schemas/milestone/open_issues`. - public var openIssues: Swift.Int - /// - Remark: Generated from `#/components/schemas/milestone/closed_issues`. - public var closedIssues: Swift.Int - /// - Remark: Generated from `#/components/schemas/milestone/created_at`. - public var createdAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/milestone/updated_at`. - public var updatedAt: Foundation.Date - /// - Remark: Generated from `#/components/schemas/milestone/closed_at`. - public var closedAt: Foundation.Date? - /// - Remark: Generated from `#/components/schemas/milestone/due_on`. - public var dueOn: Foundation.Date? - /// Creates a new `Milestone`. + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/subject_type`. + @frozen public enum SubjectTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case line = "line" + case file = "file" + } + /// The level at which the comment is targeted, can be a diff line or a file. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/subject_type`. + public var subjectType: Components.Schemas.PullRequestReviewComment.SubjectTypePayload? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/reactions`. + public var reactions: Components.Schemas.ReactionRollup? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body_html`. + public var bodyHtml: Swift.String? + /// - Remark: Generated from `#/components/schemas/pull-request-review-comment/body_text`. + public var bodyText: Swift.String? + /// Creates a new `PullRequestReviewComment`. /// /// - Parameters: - /// - url: - /// - htmlUrl: - /// - labelsUrl: - /// - id: - /// - nodeId: - /// - number: The number of the milestone. - /// - state: The state of the milestone. - /// - title: The title of the milestone. - /// - description: - /// - creator: - /// - openIssues: - /// - closedIssues: + /// - url: URL for the pull request review comment + /// - pullRequestReviewId: The ID of the pull request review to which the comment belongs. + /// - id: The ID of the pull request review comment. + /// - nodeId: The node ID of the pull request review comment. + /// - diffHunk: The diff of the line that the comment refers to. + /// - path: The relative path of the file to which the comment applies. + /// - position: The line index in the diff to which the comment applies. This field is closing down; use `line` instead. + /// - originalPosition: The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead. + /// - commitId: The SHA of the commit to which the comment applies. + /// - originalCommitId: The SHA of the original commit to which the comment applies. + /// - inReplyToId: The comment ID to reply to. + /// - user: + /// - body: The text of the comment. /// - createdAt: /// - updatedAt: - /// - closedAt: - /// - dueOn: + /// - htmlUrl: HTML URL for the pull request review comment. + /// - pullRequestUrl: URL for the pull request that the review comment belongs to. + /// - authorAssociation: + /// - _links: + /// - startLine: The first line of the range for a multi-line comment. + /// - originalStartLine: The first line of the range for a multi-line comment. + /// - startSide: The side of the first line of the range for a multi-line comment. + /// - line: The line of the blob to which the comment applies. The last line of the range for a multi-line comment + /// - originalLine: The line of the blob to which the comment applies. The last line of the range for a multi-line comment + /// - side: The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + /// - subjectType: The level at which the comment is targeted, can be a diff line or a file. + /// - reactions: + /// - bodyHtml: + /// - bodyText: public init( url: Swift.String, - htmlUrl: Swift.String, - labelsUrl: Swift.String, - id: Swift.Int, + pullRequestReviewId: Swift.Int64? = nil, + id: Swift.Int64, nodeId: Swift.String, - number: Swift.Int, - state: Components.Schemas.Milestone.StatePayload, - title: Swift.String, - description: Swift.String? = nil, - creator: Components.Schemas.NullableSimpleUser? = nil, - openIssues: Swift.Int, - closedIssues: Swift.Int, + diffHunk: Swift.String, + path: Swift.String, + position: Swift.Int? = nil, + originalPosition: Swift.Int? = nil, + commitId: Swift.String, + originalCommitId: Swift.String, + inReplyToId: Swift.Int? = nil, + user: Components.Schemas.NullableSimpleUser? = nil, + body: Swift.String, createdAt: Foundation.Date, updatedAt: Foundation.Date, - closedAt: Foundation.Date? = nil, - dueOn: Foundation.Date? = nil + htmlUrl: Swift.String, + pullRequestUrl: Swift.String, + authorAssociation: Components.Schemas.AuthorAssociation, + _links: Components.Schemas.PullRequestReviewComment._LinksPayload, + startLine: Swift.Int? = nil, + originalStartLine: Swift.Int? = nil, + startSide: Components.Schemas.PullRequestReviewComment.StartSidePayload? = nil, + line: Swift.Int? = nil, + originalLine: Swift.Int? = nil, + side: Components.Schemas.PullRequestReviewComment.SidePayload? = nil, + subjectType: Components.Schemas.PullRequestReviewComment.SubjectTypePayload? = nil, + reactions: Components.Schemas.ReactionRollup? = nil, + bodyHtml: Swift.String? = nil, + bodyText: Swift.String? = nil ) { self.url = url - self.htmlUrl = htmlUrl - self.labelsUrl = labelsUrl + self.pullRequestReviewId = pullRequestReviewId self.id = id self.nodeId = nodeId - self.number = number - self.state = state - self.title = title - self.description = description - self.creator = creator - self.openIssues = openIssues - self.closedIssues = closedIssues + self.diffHunk = diffHunk + self.path = path + self.position = position + self.originalPosition = originalPosition + self.commitId = commitId + self.originalCommitId = originalCommitId + self.inReplyToId = inReplyToId + self.user = user + self.body = body self.createdAt = createdAt self.updatedAt = updatedAt - self.closedAt = closedAt - self.dueOn = dueOn + self.htmlUrl = htmlUrl + self.pullRequestUrl = pullRequestUrl + self.authorAssociation = authorAssociation + self._links = _links + self.startLine = startLine + self.originalStartLine = originalStartLine + self.startSide = startSide + self.line = line + self.originalLine = originalLine + self.side = side + self.subjectType = subjectType + self.reactions = reactions + self.bodyHtml = bodyHtml + self.bodyText = bodyText } public enum CodingKeys: String, CodingKey { case url - case htmlUrl = "html_url" - case labelsUrl = "labels_url" + case pullRequestReviewId = "pull_request_review_id" case id case nodeId = "node_id" - case number - case state - case title - case description - case creator - case openIssues = "open_issues" - case closedIssues = "closed_issues" + case diffHunk = "diff_hunk" + case path + case position + case originalPosition = "original_position" + case commitId = "commit_id" + case originalCommitId = "original_commit_id" + case inReplyToId = "in_reply_to_id" + case user + case body case createdAt = "created_at" case updatedAt = "updated_at" - case closedAt = "closed_at" - case dueOn = "due_on" + case htmlUrl = "html_url" + case pullRequestUrl = "pull_request_url" + case authorAssociation = "author_association" + case _links + case startLine = "start_line" + case originalStartLine = "original_start_line" + case startSide = "start_side" + case line + case originalLine = "original_line" + case side + case subjectType = "subject_type" + case reactions + case bodyHtml = "body_html" + case bodyText = "body_text" } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// The direction to sort the results by. + /// Timeline Line Commented Event /// - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" + /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event`. + public struct TimelineLineCommentedEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event/event`. + public var event: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-line-commented-event/comments`. + public var comments: [Components.Schemas.PullRequestReviewComment]? + /// Creates a new `TimelineLineCommentedEvent`. + /// + /// - Parameters: + /// - event: + /// - nodeId: + /// - comments: + public init( + event: Swift.String? = nil, + nodeId: Swift.String? = nil, + comments: [Components.Schemas.PullRequestReviewComment]? = nil + ) { + self.event = event + self.nodeId = nodeId + self.comments = comments + } + public enum CodingKeys: String, CodingKey { + case event + case nodeId = "node_id" + case comments + } } - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/per-page`. - public typealias PerPage = Swift.Int - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/page`. - public typealias Page = Swift.Int - /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/parameters/since`. - public typealias Since = Foundation.Date - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/components/parameters/comment-id`. - public typealias CommentId = Swift.Int64 - /// A list of comma separated label names. Example: `bug,ui,@high` - /// - /// - Remark: Generated from `#/components/parameters/labels`. - public typealias Labels = Swift.String - /// The property to sort the results by. + /// Timeline Commit Commented Event /// - /// - Remark: Generated from `#/components/parameters/sort`. - @frozen public enum Sort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" + /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event`. + public struct TimelineCommitCommentedEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/event`. + public var event: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/node_id`. + public var nodeId: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-commit-commented-event/comments`. + public var comments: [Components.Schemas.CommitComment]? + /// Creates a new `TimelineCommitCommentedEvent`. + /// + /// - Parameters: + /// - event: + /// - nodeId: + /// - commitId: + /// - comments: + public init( + event: Swift.String? = nil, + nodeId: Swift.String? = nil, + commitId: Swift.String? = nil, + comments: [Components.Schemas.CommitComment]? = nil + ) { + self.event = event + self.nodeId = nodeId + self.commitId = commitId + self.comments = comments + } + public enum CodingKeys: String, CodingKey { + case event + case nodeId = "node_id" + case commitId = "commit_id" + case comments + } } - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String - /// The unique identifier of the issue field. + /// Timeline Assigned Issue Event /// - /// - Remark: Generated from `#/components/parameters/issue-field-id`. - public typealias IssueFieldId = Swift.Int - /// The number that identifies the issue. - /// - /// - Remark: Generated from `#/components/parameters/issue-number`. - public typealias IssueNumber = Swift.Int - /// The number that identifies the milestone. - /// - /// - Remark: Generated from `#/components/parameters/milestone-number`. - public typealias MilestoneNumber = Swift.Int - } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct ValidationFailedSimple: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. - case json(Components.Schemas.ValidationErrorSimple) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationErrorSimple { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailedSimple.Body - /// Creates a new `ValidationFailedSimple`. + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event`. + public struct TimelineAssignedIssueEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/commit_url`. + public var commitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/created_at`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/assignee`. + public var assignee: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/timeline-assigned-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? + /// Creates a new `TimelineAssignedIssueEvent`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailedSimple.Body) { - self.body = body - } - } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } + /// - id: + /// - nodeId: + /// - url: + /// - actor: + /// - event: + /// - commitId: + /// - commitUrl: + /// - createdAt: + /// - performedViaGithubApp: + /// - assignee: + /// - intent: + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + actor: Components.Schemas.SimpleUser, + event: Swift.String, + commitId: Swift.String? = nil, + commitUrl: Swift.String? = nil, + createdAt: Swift.String, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + assignee: Components.Schemas.SimpleUser, + intent: Components.Schemas.NullableIssueEventIntent? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.actor = actor + self.event = event + self.commitId = commitId + self.commitUrl = commitUrl + self.createdAt = createdAt + self.performedViaGithubApp = performedViaGithubApp + self.assignee = assignee + self.intent = intent } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.NotFound.Body) { - self.body = body + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case actor + case event + case commitId = "commit_id" + case commitUrl = "commit_url" + case createdAt = "created_at" + case performedViaGithubApp = "performed_via_github_app" + case assignee + case intent } } - public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/json", - body: self - ) - } - } - } - /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. - case applicationScimJson(Components.Schemas.ScimError) - /// The associated value of the enum case if `self` is `.applicationScimJson`. - /// - /// - Throws: An error if `self` is not `.applicationScimJson`. - /// - SeeAlso: `.applicationScimJson`. - public var applicationScimJson: Components.Schemas.ScimError { - get throws { - switch self { - case let .applicationScimJson(body): - return body - default: - try throwUnexpectedResponseBody( - expectedContent: "application/scim+json", - body: self - ) - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.BadRequest.Body - /// Creates a new `BadRequest`. + /// Timeline Unassigned Issue Event + /// + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event`. + public struct TimelineUnassignedIssueEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/commit_url`. + public var commitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/created_at`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/timeline-unassigned-issue-event/assignee`. + public var assignee: Components.Schemas.SimpleUser + /// Creates a new `TimelineUnassignedIssueEvent`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.BadRequest.Body) { - self.body = body + /// - id: + /// - nodeId: + /// - url: + /// - actor: + /// - event: + /// - commitId: + /// - commitUrl: + /// - createdAt: + /// - performedViaGithubApp: + /// - assignee: + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + actor: Components.Schemas.SimpleUser, + event: Swift.String, + commitId: Swift.String? = nil, + commitUrl: Swift.String? = nil, + createdAt: Swift.String, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + assignee: Components.Schemas.SimpleUser + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.actor = actor + self.event = event + self.commitId = commitId + self.commitUrl = commitUrl + self.createdAt = createdAt + self.performedViaGithubApp = performedViaGithubApp + self.assignee = assignee + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case actor + case event + case commitId = "commit_id" + case commitUrl = "commit_url" + case createdAt = "created_at" + case performedViaGithubApp = "performed_via_github_app" + case assignee } } - public struct ValidationFailed: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. - case json(Components.Schemas.ValidationError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailed.Body - /// Creates a new `ValidationFailed`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailed.Body) { - self.body = body - } - } - public struct NotModified: Sendable, Hashable { - /// Creates a new `NotModified`. - public init() {} - } - public struct RequiresAuthentication: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.RequiresAuthentication.Body - /// Creates a new `RequiresAuthentication`. + /// State Change Issue Event + /// + /// - Remark: Generated from `#/components/schemas/state-change-issue-event`. + public struct StateChangeIssueEvent: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/actor`. + public var actor: Components.Schemas.SimpleUser + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/event`. + public var event: Swift.String + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/commit_id`. + public var commitId: Swift.String? + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/commit_url`. + public var commitUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/created_at`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/performed_via_github_app`. + public var performedViaGithubApp: Components.Schemas.NullableIntegration? + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/state_reason`. + public var stateReason: Swift.String? + /// - Remark: Generated from `#/components/schemas/state-change-issue-event/intent`. + public var intent: Components.Schemas.NullableIssueEventIntent? + /// Creates a new `StateChangeIssueEvent`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.RequiresAuthentication.Body) { - self.body = body - } - } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } + /// - id: + /// - nodeId: + /// - url: + /// - actor: + /// - event: + /// - commitId: + /// - commitUrl: + /// - createdAt: + /// - performedViaGithubApp: + /// - stateReason: + /// - intent: + public init( + id: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + actor: Components.Schemas.SimpleUser, + event: Swift.String, + commitId: Swift.String? = nil, + commitUrl: Swift.String? = nil, + createdAt: Swift.String, + performedViaGithubApp: Components.Schemas.NullableIntegration? = nil, + stateReason: Swift.String? = nil, + intent: Components.Schemas.NullableIssueEventIntent? = nil + ) { + self.id = id + self.nodeId = nodeId + self.url = url + self.actor = actor + self.event = event + self.commitId = commitId + self.commitUrl = commitUrl + self.createdAt = createdAt + self.performedViaGithubApp = performedViaGithubApp + self.stateReason = stateReason + self.intent = intent } - /// Received HTTP response body - public var body: Components.Responses.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Forbidden.Body) { - self.body = body + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case url + case actor + case event + case commitId = "commit_id" + case commitUrl = "commit_url" + case createdAt = "created_at" + case performedViaGithubApp = "performed_via_github_app" + case stateReason = "state_reason" + case intent } } - public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/service_unavailable/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/code`. - public var code: Swift.String? - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/message`. - public var message: Swift.String? - /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/documentation_url`. - public var documentationUrl: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - code: - /// - message: - /// - documentationUrl: - public init( - code: Swift.String? = nil, - message: Swift.String? = nil, - documentationUrl: Swift.String? = nil - ) { - self.code = code - self.message = message - self.documentationUrl = documentationUrl - } - public enum CodingKeys: String, CodingKey { - case code - case message - case documentationUrl = "documentation_url" - } - } - /// - Remark: Generated from `#/components/responses/service_unavailable/content/application\/json`. - case json(Components.Responses.ServiceUnavailable.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Responses.ServiceUnavailable.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.ServiceUnavailable.Body - /// Creates a new `ServiceUnavailable`. + /// Timeline Event + /// + /// - Remark: Generated from `#/components/schemas/timeline-issue-events`. + public struct TimelineIssueEvents: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value1`. + public var value1: Components.Schemas.LabeledIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value2`. + public var value2: Components.Schemas.UnlabeledIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value3`. + public var value3: Components.Schemas.MilestonedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value4`. + public var value4: Components.Schemas.DemilestonedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value5`. + public var value5: Components.Schemas.RenamedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value6`. + public var value6: Components.Schemas.ReviewRequestedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value7`. + public var value7: Components.Schemas.ReviewRequestRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value8`. + public var value8: Components.Schemas.ReviewDismissedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value9`. + public var value9: Components.Schemas.LockedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value10`. + public var value10: Components.Schemas.AddedToProjectIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value11`. + public var value11: Components.Schemas.MovedColumnInProjectIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value12`. + public var value12: Components.Schemas.RemovedFromProjectIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value13`. + public var value13: Components.Schemas.ConvertedNoteToIssueIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value14`. + public var value14: Components.Schemas.TimelineCommentEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value15`. + public var value15: Components.Schemas.TimelineCrossReferencedEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value16`. + public var value16: Components.Schemas.TimelineCommittedEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value17`. + public var value17: Components.Schemas.TimelineReviewedEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value18`. + public var value18: Components.Schemas.TimelineLineCommentedEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value19`. + public var value19: Components.Schemas.TimelineCommitCommentedEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value20`. + public var value20: Components.Schemas.TimelineAssignedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value21`. + public var value21: Components.Schemas.TimelineUnassignedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value22`. + public var value22: Components.Schemas.StateChangeIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value23`. + public var value23: Components.Schemas.IssueTypeAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value24`. + public var value24: Components.Schemas.IssueTypeRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value25`. + public var value25: Components.Schemas.IssueTypeChangedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value26`. + public var value26: Components.Schemas.SubIssueAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value27`. + public var value27: Components.Schemas.SubIssueRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value28`. + public var value28: Components.Schemas.ParentIssueAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value29`. + public var value29: Components.Schemas.ParentIssueRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value30`. + public var value30: Components.Schemas.BlockedByAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value31`. + public var value31: Components.Schemas.BlockedByRemovedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value32`. + public var value32: Components.Schemas.BlockingAddedIssueEvent? + /// - Remark: Generated from `#/components/schemas/timeline-issue-events/value33`. + public var value33: Components.Schemas.BlockingRemovedIssueEvent? + /// Creates a new `TimelineIssueEvents`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ServiceUnavailable.Body) { - self.body = body + /// - value1: + /// - value2: + /// - value3: + /// - value4: + /// - value5: + /// - value6: + /// - value7: + /// - value8: + /// - value9: + /// - value10: + /// - value11: + /// - value12: + /// - value13: + /// - value14: + /// - value15: + /// - value16: + /// - value17: + /// - value18: + /// - value19: + /// - value20: + /// - value21: + /// - value22: + /// - value23: + /// - value24: + /// - value25: + /// - value26: + /// - value27: + /// - value28: + /// - value29: + /// - value30: + /// - value31: + /// - value32: + /// - value33: + public init( + value1: Components.Schemas.LabeledIssueEvent? = nil, + value2: Components.Schemas.UnlabeledIssueEvent? = nil, + value3: Components.Schemas.MilestonedIssueEvent? = nil, + value4: Components.Schemas.DemilestonedIssueEvent? = nil, + value5: Components.Schemas.RenamedIssueEvent? = nil, + value6: Components.Schemas.ReviewRequestedIssueEvent? = nil, + value7: Components.Schemas.ReviewRequestRemovedIssueEvent? = nil, + value8: Components.Schemas.ReviewDismissedIssueEvent? = nil, + value9: Components.Schemas.LockedIssueEvent? = nil, + value10: Components.Schemas.AddedToProjectIssueEvent? = nil, + value11: Components.Schemas.MovedColumnInProjectIssueEvent? = nil, + value12: Components.Schemas.RemovedFromProjectIssueEvent? = nil, + value13: Components.Schemas.ConvertedNoteToIssueIssueEvent? = nil, + value14: Components.Schemas.TimelineCommentEvent? = nil, + value15: Components.Schemas.TimelineCrossReferencedEvent? = nil, + value16: Components.Schemas.TimelineCommittedEvent? = nil, + value17: Components.Schemas.TimelineReviewedEvent? = nil, + value18: Components.Schemas.TimelineLineCommentedEvent? = nil, + value19: Components.Schemas.TimelineCommitCommentedEvent? = nil, + value20: Components.Schemas.TimelineAssignedIssueEvent? = nil, + value21: Components.Schemas.TimelineUnassignedIssueEvent? = nil, + value22: Components.Schemas.StateChangeIssueEvent? = nil, + value23: Components.Schemas.IssueTypeAddedIssueEvent? = nil, + value24: Components.Schemas.IssueTypeRemovedIssueEvent? = nil, + value25: Components.Schemas.IssueTypeChangedIssueEvent? = nil, + value26: Components.Schemas.SubIssueAddedIssueEvent? = nil, + value27: Components.Schemas.SubIssueRemovedIssueEvent? = nil, + value28: Components.Schemas.ParentIssueAddedIssueEvent? = nil, + value29: Components.Schemas.ParentIssueRemovedIssueEvent? = nil, + value30: Components.Schemas.BlockedByAddedIssueEvent? = nil, + value31: Components.Schemas.BlockedByRemovedIssueEvent? = nil, + value32: Components.Schemas.BlockingAddedIssueEvent? = nil, + value33: Components.Schemas.BlockingRemovedIssueEvent? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + self.value4 = value4 + self.value5 = value5 + self.value6 = value6 + self.value7 = value7 + self.value8 = value8 + self.value9 = value9 + self.value10 = value10 + self.value11 = value11 + self.value12 = value12 + self.value13 = value13 + self.value14 = value14 + self.value15 = value15 + self.value16 = value16 + self.value17 = value17 + self.value18 = value18 + self.value19 = value19 + self.value20 = value20 + self.value21 = value21 + self.value22 = value22 + self.value23 = value23 + self.value24 = value24 + self.value25 = value25 + self.value26 = value26 + self.value27 = value27 + self.value28 = value28 + self.value29 = value29 + self.value30 = value30 + self.value31 = value31 + self.value32 = value32 + self.value33 = value33 } - } - public struct MovedPermanently: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/moved_permanently/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/moved_permanently/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// Received HTTP response body - public var body: Components.Responses.MovedPermanently.Body - /// Creates a new `MovedPermanently`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.MovedPermanently.Body) { - self.body = body - } - } - public struct Gone: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// Received HTTP response body - public var body: Components.Responses.Gone.Body - /// Creates a new `Gone`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.Gone.Body) { - self.body = body - } - } - } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias Link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// List issues assigned to the authenticated user - /// - /// List issues assigned to the authenticated user across all visible repositories including owned repositories, member - /// repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not - /// necessarily assigned to you. - /// - /// > [!NOTE] - /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." - /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. - /// - /// - Remark: HTTP `GET /issues`. - /// - Remark: Generated from `#/paths//issues/get(issues/list)`. - public enum IssuesList { - public static let id: Swift.String = "issues/list" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/issues/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/issues/GET/query/filter`. - @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { - case assigned = "assigned" - case created = "created" - case mentioned = "mentioned" - case subscribed = "subscribed" - case repos = "repos" - case all = "all" + do { + self.value3 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. - /// - /// - Remark: Generated from `#/paths/issues/GET/query/filter`. - public var filter: Operations.IssuesList.Input.Query.FilterPayload? - /// - Remark: Generated from `#/paths/issues/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" + do { + self.value4 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Indicates the state of the issues to return. - /// - /// - Remark: Generated from `#/paths/issues/GET/query/state`. - public var state: Operations.IssuesList.Input.Query.StatePayload? - /// A list of comma separated label names. Example: `bug,ui,@high` - /// - /// - Remark: Generated from `#/paths/issues/GET/query/labels`. - public var labels: Components.Parameters.Labels? - /// - Remark: Generated from `#/paths/issues/GET/query/sort`. - @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - case comments = "comments" + do { + self.value5 = try .init(from: decoder) + } catch { + errors.append(error) } - /// What to sort results by. - /// - /// - Remark: Generated from `#/paths/issues/GET/query/sort`. - public var sort: Operations.IssuesList.Input.Query.SortPayload? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" + do { + self.value6 = try .init(from: decoder) + } catch { + errors.append(error) } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/issues/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/issues/GET/query/since`. - public var since: Components.Parameters.Since? - /// - Remark: Generated from `#/paths/issues/GET/query/collab`. - public var collab: Swift.Bool? - /// - Remark: Generated from `#/paths/issues/GET/query/orgs`. - public var orgs: Swift.Bool? - /// - Remark: Generated from `#/paths/issues/GET/query/owned`. - public var owned: Swift.Bool? - /// - Remark: Generated from `#/paths/issues/GET/query/pulls`. - public var pulls: Swift.Bool? - /// 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/issues/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/issues/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - filter: Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. - /// - state: Indicates the state of the issues to return. - /// - labels: A list of comma separated label names. Example: `bug,ui,@high` - /// - sort: What to sort results by. - /// - direction: The direction to sort the results by. - /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - collab: - /// - orgs: - /// - owned: - /// - pulls: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - filter: Operations.IssuesList.Input.Query.FilterPayload? = nil, - state: Operations.IssuesList.Input.Query.StatePayload? = nil, - labels: Components.Parameters.Labels? = nil, - sort: Operations.IssuesList.Input.Query.SortPayload? = nil, - direction: Components.Parameters.Direction? = nil, - since: Components.Parameters.Since? = nil, - collab: Swift.Bool? = nil, - orgs: Swift.Bool? = nil, - owned: Swift.Bool? = nil, - pulls: Swift.Bool? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.filter = filter - self.state = state - self.labels = labels - self.sort = sort - self.direction = direction - self.since = since - self.collab = collab - self.orgs = orgs - self.owned = owned - self.pulls = pulls - self.perPage = perPage - self.page = page + do { + self.value7 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var query: Operations.IssuesList.Input.Query - /// - Remark: Generated from `#/paths/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 + do { + self.value8 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var headers: Operations.IssuesList.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - query: - /// - headers: - public init( - query: Operations.IssuesList.Input.Query = .init(), - headers: Operations.IssuesList.Input.Headers = .init() - ) { - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/issues/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/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 - } + do { + self.value9 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Received HTTP response headers - public var headers: Operations.IssuesList.Output.Ok.Headers - /// - Remark: Generated from `#/paths/issues/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/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 - } - } - } + do { + self.value10 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Received HTTP response body - public var body: Operations.IssuesList.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesList.Output.Ok.Headers = .init(), - body: Operations.IssuesList.Output.Ok.Body - ) { - self.headers = headers - self.body = body + do { + self.value11 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// Response - /// - /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesList.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.IssuesList.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } + do { + self.value12 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } + do { + self.value13 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// Not modified - /// - /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified - /// - /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. - /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { - switch self { - case let .notModified(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notModified", - response: self - ) - } + do { + self.value14 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } + do { + self.value15 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// 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) + do { + self.value16 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" + do { + self.value17 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List organization issues assigned to the authenticated user - /// - /// List issues in an organization assigned to the authenticated user. - /// - /// > [!NOTE] - /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." - /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. - /// - /// - Remark: HTTP `GET /orgs/{org}/issues`. - /// - Remark: Generated from `#/paths//orgs/{org}/issues/get(issues/list-for-org)`. - public enum IssuesListForOrg { - public static let id: Swift.String = "issues/list-for-org" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/path/org`. - public var org: Components.Parameters.Org - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + do { + self.value18 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var path: Operations.IssuesListForOrg.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/filter`. - @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { - case assigned = "assigned" - case created = "created" - case mentioned = "mentioned" - case subscribed = "subscribed" - case repos = "repos" - case all = "all" + do { + self.value19 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/filter`. - public var filter: Operations.IssuesListForOrg.Input.Query.FilterPayload? - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" - case all = "all" + do { + self.value20 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Indicates the state of the issues to return. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/state`. - public var state: Operations.IssuesListForOrg.Input.Query.StatePayload? - /// A list of comma separated label names. Example: `bug,ui,@high` - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/labels`. - public var labels: Components.Parameters.Labels? - /// Can be the name of an issue type. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/type`. - public var _type: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/sort`. - @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - case comments = "comments" + do { + self.value21 = try .init(from: decoder) + } catch { + errors.append(error) } - /// What to sort results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/sort`. - public var sort: Operations.IssuesListForOrg.Input.Query.SortPayload? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" + do { + self.value22 = try .init(from: decoder) + } catch { + errors.append(error) } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/since`. - public var since: Components.Parameters.Since? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - filter: Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. - /// - state: Indicates the state of the issues to return. - /// - labels: A list of comma separated label names. Example: `bug,ui,@high` - /// - _type: Can be the name of an issue type. - /// - sort: What to sort results by. - /// - direction: The direction to sort the results by. - /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - filter: Operations.IssuesListForOrg.Input.Query.FilterPayload? = nil, - state: Operations.IssuesListForOrg.Input.Query.StatePayload? = nil, - labels: Components.Parameters.Labels? = nil, - _type: Swift.String? = nil, - sort: Operations.IssuesListForOrg.Input.Query.SortPayload? = nil, - direction: Components.Parameters.Direction? = nil, - since: Components.Parameters.Since? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.filter = filter - self.state = state - self.labels = labels - self._type = _type - self.sort = sort - self.direction = direction - self.since = since - self.perPage = perPage - self.page = page + do { + self.value23 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var query: Operations.IssuesListForOrg.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/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 + do { + self.value24 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var headers: Operations.IssuesListForOrg.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.IssuesListForOrg.Input.Path, - query: Operations.IssuesListForOrg.Input.Query = .init(), - headers: Operations.IssuesListForOrg.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/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 - } + do { + self.value25 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Received HTTP response headers - public var headers: Operations.IssuesListForOrg.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/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 - } - } - } + do { + self.value26 = try .init(from: decoder) + } catch { + errors.append(error) } - /// Received HTTP response body - public var body: Operations.IssuesListForOrg.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListForOrg.Output.Ok.Headers = .init(), - body: Operations.IssuesListForOrg.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/issues/get(issues/list-for-org)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListForOrg.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.IssuesListForOrg.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } + do { + self.value27 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//orgs/{org}/issues/get(issues/list-for-org)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } + do { + self.value28 = try .init(from: decoder) + } catch { + errors.append(error) } - } - /// 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) + do { + self.value29 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" + do { + self.value30 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// List assignees - /// - /// Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/assignees`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/get(issues/list-assignees)`. - public enum IssuesListAssignees { - public static let id: Swift.String = "issues/list-assignees" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/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}/assignees/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}/assignees/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 + do { + self.value31 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var path: Operations.IssuesListAssignees.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/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}/assignees/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page + do { + self.value32 = try .init(from: decoder) + } catch { + errors.append(error) } - } - public var query: Operations.IssuesListAssignees.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/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 + do { + self.value33 = try .init(from: decoder) + } catch { + errors.append(error) } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3, + self.value4, + self.value5, + self.value6, + self.value7, + self.value8, + self.value9, + self.value10, + self.value11, + self.value12, + self.value13, + self.value14, + self.value15, + self.value16, + self.value17, + self.value18, + self.value19, + self.value20, + self.value21, + self.value22, + self.value23, + self.value24, + self.value25, + self.value26, + self.value27, + self.value28, + self.value29, + self.value30, + self.value31, + self.value32, + self.value33 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public var headers: Operations.IssuesListAssignees.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.IssuesListAssignees.Input.Path, - query: Operations.IssuesListAssignees.Input.Query = .init(), - headers: Operations.IssuesListAssignees.Input.Headers = .init() - ) { - self.path = path - self.query = query - self.headers = headers + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + try self.value3?.encode(to: encoder) + try self.value4?.encode(to: encoder) + try self.value5?.encode(to: encoder) + try self.value6?.encode(to: encoder) + try self.value7?.encode(to: encoder) + try self.value8?.encode(to: encoder) + try self.value9?.encode(to: encoder) + try self.value10?.encode(to: encoder) + try self.value11?.encode(to: encoder) + try self.value12?.encode(to: encoder) + try self.value13?.encode(to: encoder) + try self.value14?.encode(to: encoder) + try self.value15?.encode(to: encoder) + try self.value16?.encode(to: encoder) + try self.value17?.encode(to: encoder) + try self.value18?.encode(to: encoder) + try self.value19?.encode(to: encoder) + try self.value20?.encode(to: encoder) + try self.value21?.encode(to: encoder) + try self.value22?.encode(to: encoder) + try self.value23?.encode(to: encoder) + try self.value24?.encode(to: encoder) + try self.value25?.encode(to: encoder) + try self.value26?.encode(to: encoder) + try self.value27?.encode(to: encoder) + try self.value28?.encode(to: encoder) + try self.value29?.encode(to: encoder) + try self.value30?.encode(to: encoder) + try self.value31?.encode(to: encoder) + try self.value32?.encode(to: encoder) + try self.value33?.encode(to: encoder) } } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/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.IssuesListAssignees.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesListAssignees.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListAssignees.Output.Ok.Headers = .init(), - body: Operations.IssuesListAssignees.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/get(issues/list-assignees)/responses/200`. + /// A collection of related issues and pull requests. + /// + /// - Remark: Generated from `#/components/schemas/milestone`. + public struct Milestone: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/milestone/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/milestone/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/milestone/labels_url`. + public var labelsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/milestone/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/milestone/node_id`. + public var nodeId: Swift.String + /// The number of the milestone. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListAssignees.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// - Remark: Generated from `#/components/schemas/milestone/number`. + public var number: Swift.Int + /// The state of the milestone. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesListAssignees.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } + /// - Remark: Generated from `#/components/schemas/milestone/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/get(issues/list-assignees)/responses/404`. + /// The state of the milestone. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// - Remark: Generated from `#/components/schemas/milestone/state`. + public var state: Components.Schemas.Milestone.StatePayload + /// The title of the milestone. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Undocumented response. + /// - Remark: Generated from `#/components/schemas/milestone/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/milestone/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/components/schemas/milestone/creator`. + public var creator: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/milestone/open_issues`. + public var openIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/milestone/closed_issues`. + public var closedIssues: Swift.Int + /// - Remark: Generated from `#/components/schemas/milestone/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/milestone/updated_at`. + public var updatedAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/milestone/closed_at`. + public var closedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/milestone/due_on`. + public var dueOn: Foundation.Date? + /// Creates a new `Milestone`. /// - /// 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" - } + /// - Parameters: + /// - url: + /// - htmlUrl: + /// - labelsUrl: + /// - id: + /// - nodeId: + /// - number: The number of the milestone. + /// - state: The state of the milestone. + /// - title: The title of the milestone. + /// - description: + /// - creator: + /// - openIssues: + /// - closedIssues: + /// - createdAt: + /// - updatedAt: + /// - closedAt: + /// - dueOn: + public init( + url: Swift.String, + htmlUrl: Swift.String, + labelsUrl: Swift.String, + id: Swift.Int, + nodeId: Swift.String, + number: Swift.Int, + state: Components.Schemas.Milestone.StatePayload, + title: Swift.String, + description: Swift.String? = nil, + creator: Components.Schemas.NullableSimpleUser? = nil, + openIssues: Swift.Int, + closedIssues: Swift.Int, + createdAt: Foundation.Date, + updatedAt: Foundation.Date, + closedAt: Foundation.Date? = nil, + dueOn: Foundation.Date? = nil + ) { + self.url = url + self.htmlUrl = htmlUrl + self.labelsUrl = labelsUrl + self.id = id + self.nodeId = nodeId + self.number = number + self.state = state + self.title = title + self.description = description + self.creator = creator + self.openIssues = openIssues + self.closedIssues = closedIssues + self.createdAt = createdAt + self.updatedAt = updatedAt + self.closedAt = closedAt + self.dueOn = dueOn } - public static var allCases: [Self] { - [ - .json - ] + public enum CodingKeys: String, CodingKey { + case url + case htmlUrl = "html_url" + case labelsUrl = "labels_url" + case id + case nodeId = "node_id" + case number + case state + case title + case description + case creator + case openIssues = "open_issues" + case closedIssues = "closed_issues" + case createdAt = "created_at" + case updatedAt = "updated_at" + case closedAt = "closed_at" + case dueOn = "due_on" } } } - /// Check if a user can be assigned - /// - /// Checks if a user has permission to be assigned to an issue in this repository. - /// - /// If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. - /// - /// Otherwise a `404` status code is returned. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/assignees/{assignee}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)`. - public enum IssuesCheckUserCanBeAssigned { - public static let id: Swift.String = "issues/check-user-can-be-assigned" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/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}/assignees/{assignee}/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}/assignees/{assignee}/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/path/assignee`. - public var assignee: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - assignee: - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - assignee: Swift.String - ) { - self.owner = owner - self.repo = repo - self.assignee = assignee - } - } - public var path: Operations.IssuesCheckUserCanBeAssigned.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/parameters/since`. + public typealias Since = Foundation.Date + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The unique identifier of the comment. + /// + /// - Remark: Generated from `#/components/parameters/comment-id`. + public typealias CommentId = Swift.Int64 + /// A list of comma separated label names. Example: `bug,ui,@high` + /// + /// - Remark: Generated from `#/components/parameters/labels`. + public typealias Labels = Swift.String + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/sort`. + @frozen public enum Sort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + } + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String + /// The unique identifier of the issue field. + /// + /// - Remark: Generated from `#/components/parameters/issue-field-id`. + public typealias IssueFieldId = Swift.Int + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/components/parameters/issue-number`. + public typealias IssueNumber = Swift.Int + /// A comma-separated list of timeline event names to exclude from the response. + /// + /// - Remark: Generated from `#/components/parameters/issue-timeline-exclude`. + public typealias IssueTimelineExclude = Swift.String + /// The number that identifies the milestone. + /// + /// - Remark: Generated from `#/components/parameters/milestone-number`. + public typealias MilestoneNumber = Swift.Int + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body + } + } } } - public var headers: Operations.IssuesCheckUserCanBeAssigned.Input.Headers - /// Creates a new `Input`. + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. /// /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.IssuesCheckUserCanBeAssigned.Input.Path, - headers: Operations.IssuesCheckUserCanBeAssigned.Input.Headers = .init() - ) { - self.path = path - self.headers = headers + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailedSimple.Body) { + self.body = body } } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesCheckUserCanBeAssigned.Output.NoContent) - /// If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesCheckUserCanBeAssigned.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } } } } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/responses/404/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/responses/404/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/json", + body: self + ) } } } - /// Received HTTP response body - public var body: Operations.IssuesCheckUserCanBeAssigned.Output.NotFound.Body - /// Creates a new `NotFound`. + /// - Remark: Generated from `#/components/responses/bad_request/content/application\/scim+json`. + case applicationScimJson(Components.Schemas.ScimError) + /// The associated value of the enum case if `self` is `.applicationScimJson`. /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesCheckUserCanBeAssigned.Output.NotFound.Body) { - self.body = body - } - } - /// Otherwise a `404` status code is returned. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.IssuesCheckUserCanBeAssigned.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.IssuesCheckUserCanBeAssigned.Output.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) + /// - Throws: An error if `self` is not `.applicationScimJson`. + /// - SeeAlso: `.applicationScimJson`. + public var applicationScimJson: Components.Schemas.ScimError { + get throws { + switch self { + case let .applicationScimJson(body): + return body + default: + try throwUnexpectedResponseBody( + expectedContent: "application/scim+json", + body: self + ) + } } } } - /// Undocumented response. + /// Received HTTP response body + public var body: Components.Responses.BadRequest.Body + /// Creates a new `BadRequest`. /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.BadRequest.Body) { + self.body = body + } } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) + public struct ValidationFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } } } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" + /// Received HTTP response body + public var body: Components.Responses.ValidationFailed.Body + /// Creates a new `ValidationFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailed.Body) { + self.body = body + } + } + public struct NotModified: Sendable, Hashable { + /// Creates a new `NotModified`. + public init() {} + } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } } } - public static var allCases: [Self] { - [ - .json - ] + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } + public struct Gone: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Gone.Body + /// Creates a new `Gone`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Gone.Body) { + self.body = body + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/code`. + public var code: Swift.String? + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/responses/service_unavailable/content/json/documentation_url`. + public var documentationUrl: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - code: + /// - message: + /// - documentationUrl: + public init( + code: Swift.String? = nil, + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil + ) { + self.code = code + self.message = message + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case code + case message + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/components/responses/service_unavailable/content/application\/json`. + case json(Components.Responses.ServiceUnavailable.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Responses.ServiceUnavailable.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.ServiceUnavailable.Body) { + self.body = body + } + } + public struct MovedPermanently: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/moved_permanently/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/moved_permanently/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.MovedPermanently.Body + /// Creates a new `MovedPermanently`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.MovedPermanently.Body) { + self.body = body } } } - /// List repository issues + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias Link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List issues assigned to the authenticated user /// - /// List issues in a repository. Only open issues will be listed. + /// List issues assigned to the authenticated user across all visible repositories including owned repositories, member + /// repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not + /// necessarily assigned to you. /// /// > [!NOTE] /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. @@ -12137,42 +11907,27 @@ public enum Operations { /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)`. - public enum IssuesListForRepo { - public static let id: Swift.String = "issues/list-for-repo" + /// - Remark: HTTP `GET /issues`. + /// - Remark: Generated from `#/paths//issues/get(issues/list)`. + public enum IssuesList { + public static let id: Swift.String = "issues/list" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/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/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.IssuesListForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query`. + /// - Remark: Generated from `#/paths/issues/GET/query`. public struct Query: Sendable, Hashable { - /// If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. + /// - Remark: Generated from `#/paths/issues/GET/query/filter`. + @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { + case assigned = "assigned" + case created = "created" + case mentioned = "mentioned" + case subscribed = "subscribed" + case repos = "repos" + case all = "all" + } + /// Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/milestone`. - public var milestone: Swift.String? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/state`. + /// - Remark: Generated from `#/paths/issues/GET/query/filter`. + public var filter: Operations.IssuesList.Input.Query.FilterPayload? + /// - Remark: Generated from `#/paths/issues/GET/query/state`. @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { case open = "open" case closed = "closed" @@ -12180,40 +11935,13 @@ public enum Operations { } /// Indicates the state of the issues to return. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/state`. - public var state: Operations.IssuesListForRepo.Input.Query.StatePayload? - /// Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/assignee`. - public var assignee: Swift.String? - /// Can be the name of an issue type. If the string `*` is passed, issues with any type are accepted. If the string `none` is passed, issues without type are returned. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/type`. - public var _type: Swift.String? - /// The user that created the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/creator`. - public var creator: Swift.String? - /// A user that's mentioned in the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/mentioned`. - public var mentioned: Swift.String? - /// A comma-separated list of issue field filters in `field_slug:value` format. - /// Only issues matching all specified field values are returned. - /// Requires issue fields to be enabled for the repository. Issue fields are - /// not available for user-owned repositories, and field availability for - /// organization-owned public repositories depends on the organization's - /// visibility settings. For example, `priority:Urgent,severity:High` filters - /// issues where the `priority` field is `Urgent` AND the `severity` field is - /// `High`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/issue_field_values`. - public var issueFieldValues: Swift.String? + /// - Remark: Generated from `#/paths/issues/GET/query/state`. + public var state: Operations.IssuesList.Input.Query.StatePayload? /// A list of comma separated label names. Example: `bug,ui,@high` /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/labels`. + /// - Remark: Generated from `#/paths/issues/GET/query/labels`. public var labels: Components.Parameters.Labels? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/sort`. + /// - Remark: Generated from `#/paths/issues/GET/query/sort`. @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { case created = "created" case updated = "updated" @@ -12221,8 +11949,8 @@ public enum Operations { } /// What to sort results by. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/sort`. - public var sort: Operations.IssuesListForRepo.Input.Query.SortPayload? + /// - Remark: Generated from `#/paths/issues/GET/query/sort`. + public var sort: Operations.IssuesList.Input.Query.SortPayload? /// - Remark: Generated from `#/components/parameters/direction`. @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { case asc = "asc" @@ -12230,100 +11958,102 @@ public enum Operations { } /// The direction to sort the results by. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/direction`. + /// - Remark: Generated from `#/paths/issues/GET/query/direction`. public var direction: Components.Parameters.Direction? /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/since`. + /// - Remark: Generated from `#/paths/issues/GET/query/since`. public var since: Components.Parameters.Since? + /// - Remark: Generated from `#/paths/issues/GET/query/collab`. + public var collab: Swift.Bool? + /// - Remark: Generated from `#/paths/issues/GET/query/orgs`. + public var orgs: Swift.Bool? + /// - Remark: Generated from `#/paths/issues/GET/query/owned`. + public var owned: Swift.Bool? + /// - Remark: Generated from `#/paths/issues/GET/query/pulls`. + public var pulls: Swift.Bool? /// 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/GET/query/per_page`. + /// - Remark: Generated from `#/paths/issues/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/page`. + /// - Remark: Generated from `#/paths/issues/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - milestone: If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. + /// - filter: Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. /// - state: Indicates the state of the issues to return. - /// - assignee: Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. - /// - _type: Can be the name of an issue type. If the string `*` is passed, issues with any type are accepted. If the string `none` is passed, issues without type are returned. - /// - creator: The user that created the issue. - /// - mentioned: A user that's mentioned in the issue. - /// - issueFieldValues: A comma-separated list of issue field filters in `field_slug:value` format. /// - labels: A list of comma separated label names. Example: `bug,ui,@high` /// - sort: What to sort results by. /// - direction: The direction to sort the results by. /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - collab: + /// - orgs: + /// - owned: + /// - pulls: /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( - milestone: Swift.String? = nil, - state: Operations.IssuesListForRepo.Input.Query.StatePayload? = nil, - assignee: Swift.String? = nil, - _type: Swift.String? = nil, - creator: Swift.String? = nil, - mentioned: Swift.String? = nil, - issueFieldValues: Swift.String? = nil, + filter: Operations.IssuesList.Input.Query.FilterPayload? = nil, + state: Operations.IssuesList.Input.Query.StatePayload? = nil, labels: Components.Parameters.Labels? = nil, - sort: Operations.IssuesListForRepo.Input.Query.SortPayload? = nil, + sort: Operations.IssuesList.Input.Query.SortPayload? = nil, direction: Components.Parameters.Direction? = nil, since: Components.Parameters.Since? = nil, + collab: Swift.Bool? = nil, + orgs: Swift.Bool? = nil, + owned: Swift.Bool? = nil, + pulls: Swift.Bool? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { - self.milestone = milestone + self.filter = filter self.state = state - self.assignee = assignee - self._type = _type - self.creator = creator - self.mentioned = mentioned - self.issueFieldValues = issueFieldValues self.labels = labels self.sort = sort self.direction = direction self.since = since + self.collab = collab + self.orgs = orgs + self.owned = owned + self.pulls = pulls self.perPage = perPage self.page = page } } - public var query: Operations.IssuesListForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/header`. + public var query: Operations.IssuesList.Input.Query + /// - Remark: Generated from `#/paths/issues/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListForRepo.Input.Headers + public var headers: Operations.IssuesList.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - query: /// - headers: public init( - path: Operations.IssuesListForRepo.Input.Path, - query: Operations.IssuesListForRepo.Input.Query = .init(), - headers: Operations.IssuesListForRepo.Input.Headers = .init() + query: Operations.IssuesList.Input.Query = .init(), + headers: Operations.IssuesList.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/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/issues/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/issues/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -12334,10 +12064,10 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesListForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/responses/200/content`. + public var headers: Operations.IssuesList.Output.Ok.Headers + /// - Remark: Generated from `#/paths/issues/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/issues/GET/responses/200/content/application\/json`. case json([Components.Schemas.Issue]) /// The associated value of the enum case if `self` is `.json`. /// @@ -12353,15 +12083,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListForRepo.Output.Ok.Body + public var body: Operations.IssuesList.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListForRepo.Output.Ok.Headers = .init(), - body: Operations.IssuesListForRepo.Output.Ok.Body + headers: Operations.IssuesList.Output.Ok.Headers = .init(), + body: Operations.IssuesList.Output.Ok.Body ) { self.headers = headers self.body = body @@ -12369,15 +12099,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListForRepo.Output.Ok) + case ok(Operations.IssuesList.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.IssuesListForRepo.Output.Ok { + public var ok: Operations.IssuesList.Output.Ok { get throws { switch self { case let .ok(response): @@ -12390,47 +12120,55 @@ public enum Operations { } } } - /// Moved permanently + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/301`. + /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/422`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .movedPermanently(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Not modified /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/422`. + /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/304`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { get throws { switch self { - case let .unprocessableContent(response): + case let .notModified(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notModified", response: self ) } @@ -12438,7 +12176,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/404`. + /// - Remark: Generated from `#/paths//issues/get(issues/list)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -12490,12 +12228,12 @@ public enum Operations { } } } - /// Create an issue + /// List organization issues assigned to the authenticated user /// - /// Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. + /// List issues in an organization assigned to the authenticated user. /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// > [!NOTE] + /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -12504,549 +12242,227 @@ public enum Operations { /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)`. - public enum IssuesCreate { - public static let id: Swift.String = "issues/create" + /// - Remark: HTTP `GET /orgs/{org}/issues`. + /// - Remark: Generated from `#/paths//orgs/{org}/issues/get(issues/list-for-org)`. + public enum IssuesListForOrg { + public static let id: Swift.String = "issues/list-for-org" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/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/POST/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/path/repo`. - public var repo: Components.Parameters.Repo + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/path/org`. + public var org: Components.Parameters.Org /// 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 + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var path: Operations.IssuesCreate.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/header`. + public var path: Operations.IssuesListForOrg.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/filter`. + @frozen public enum FilterPayload: String, Codable, Hashable, Sendable, CaseIterable { + case assigned = "assigned" + case created = "created" + case mentioned = "mentioned" + case subscribed = "subscribed" + case repos = "repos" + case all = "all" + } + /// Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/filter`. + public var filter: Operations.IssuesListForOrg.Input.Query.FilterPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" + } + /// Indicates the state of the issues to return. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/state`. + public var state: Operations.IssuesListForOrg.Input.Query.StatePayload? + /// A list of comma separated label names. Example: `bug,ui,@high` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/labels`. + public var labels: Components.Parameters.Labels? + /// Can be the name of an issue type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/type`. + public var _type: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/sort`. + @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case comments = "comments" + } + /// What to sort results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/sort`. + public var sort: Operations.IssuesListForOrg.Input.Query.SortPayload? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/since`. + public var since: Components.Parameters.Since? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - filter: Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + /// - state: Indicates the state of the issues to return. + /// - labels: A list of comma separated label names. Example: `bug,ui,@high` + /// - _type: Can be the name of an issue type. + /// - sort: What to sort results by. + /// - direction: The direction to sort the results by. + /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + filter: Operations.IssuesListForOrg.Input.Query.FilterPayload? = nil, + state: Operations.IssuesListForOrg.Input.Query.StatePayload? = nil, + labels: Components.Parameters.Labels? = nil, + _type: Swift.String? = nil, + sort: Operations.IssuesListForOrg.Input.Query.SortPayload? = nil, + direction: Components.Parameters.Direction? = nil, + since: Components.Parameters.Since? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.filter = filter + self.state = state + self.labels = labels + self._type = _type + self.sort = sort + self.direction = direction + self.since = since + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListForOrg.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesCreate.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The title of the issue. + public var headers: Operations.IssuesListForOrg.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.IssuesListForOrg.Input.Path, + query: Operations.IssuesListForOrg.Input.Query = .init(), + headers: Operations.IssuesListForOrg.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title`. - @frozen public enum TitlePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title/case2`. - case case2(Swift.Int) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } - /// The title of the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title`. - public var title: Operations.IssuesCreate.Input.Body.JsonPayload.TitlePayload - /// The contents of the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/body`. - public var body: Swift.String? - /// Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is closing down.**_ + } + /// Received HTTP response headers + public var headers: Operations.IssuesListForOrg.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/issues/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Issue]) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/assignee`. - public var assignee: Swift.String? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone`. - @frozen public enum MilestonePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone/case1`. - case case1(Swift.String) - /// The `number` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._ - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone/case2`. - case case2(Swift.Int) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Issue] { + get throws { switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) + case let .json(body): + return body } } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone`. - public var milestone: Operations.IssuesCreate.Input.Body.JsonPayload.MilestonePayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload`. - @frozen public enum LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/color`. - public var color: Swift.String? - /// Creates a new `Case2Payload`. - /// - /// - Parameters: - /// - id: - /// - name: - /// - description: - /// - color: - public init( - id: Swift.Int? = nil, - name: Swift.String? = nil, - description: Swift.String? = nil, - color: Swift.String? = nil - ) { - self.id = id - self.name = name - self.description = description - self.color = color - } - public enum CodingKeys: String, CodingKey { - case id - case name - case description - case color - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2`. - case case2(Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try value.encode(to: encoder) - } - } - } - /// Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/labels`. - public typealias LabelsPayload = [Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayloadPayload] - /// Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/labels`. - public var labels: Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayload? - /// Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/assignees`. - public var assignees: [Swift.String]? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload`. - public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the issue field to set - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/field_id`. - public var fieldId: Swift.Int - /// The value to set for the field. For multi-select fields, provide an array of option names. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case2`. - case case2(Swift.Double) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case3`. - case case3([Swift.String]) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The value to set for the field. For multi-select fields, provide an array of option names. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value`. - public var value: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload - /// Creates a new `IssueFieldValuesPayloadPayload`. - /// - /// - Parameters: - /// - fieldId: The ID of the issue field to set - /// - value: The value to set for the field. For multi-select fields, provide an array of option names. - public init( - fieldId: Swift.Int, - value: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload - ) { - self.fieldId = fieldId - self.value = value - } - public enum CodingKeys: String, CodingKey { - case fieldId = "field_id" - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.fieldId = try container.decode( - Swift.Int.self, - forKey: .fieldId - ) - self.value = try container.decode( - Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "field_id", - "value" - ]) - } - } - /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/issue_field_values`. - public typealias IssueFieldValuesPayload = [Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] - /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/issue_field_values`. - public var issueFieldValues: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayload? - /// The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/type`. - public var _type: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - title: The title of the issue. - /// - body: The contents of the issue. - /// - assignee: Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is closing down.**_ - /// - milestone: - /// - labels: Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ - /// - assignees: Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ - /// - issueFieldValues: An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. - /// - _type: The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ - public init( - title: Operations.IssuesCreate.Input.Body.JsonPayload.TitlePayload, - body: Swift.String? = nil, - assignee: Swift.String? = nil, - milestone: Operations.IssuesCreate.Input.Body.JsonPayload.MilestonePayload? = nil, - labels: Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayload? = nil, - assignees: [Swift.String]? = nil, - issueFieldValues: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil, - _type: Swift.String? = nil - ) { - self.title = title - self.body = body - self.assignee = assignee - self.milestone = milestone - self.labels = labels - self.assignees = assignees - self.issueFieldValues = issueFieldValues - self._type = _type - } - public enum CodingKeys: String, CodingKey { - case title - case body - case assignee - case milestone - case labels - case assignees - case issueFieldValues = "issue_field_values" - case _type = "type" - } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/content/application\/json`. - case json(Operations.IssuesCreate.Input.Body.JsonPayload) + /// Received HTTP response body + public var body: Operations.IssuesListForOrg.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListForOrg.Output.Ok.Headers = .init(), + body: Operations.IssuesListForOrg.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - public var body: Operations.IssuesCreate.Input.Body - /// Creates a new `Input`. + /// Response /// - /// - Parameters: - /// - path: - /// - headers: - /// - body: - public init( - path: Operations.IssuesCreate.Input.Path, - headers: Operations.IssuesCreate.Input.Headers = .init(), - body: Operations.IssuesCreate.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/POST/responses/201/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesCreate.Output.Created.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesCreate.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesCreate.Output.Created.Headers = .init(), - body: Operations.IssuesCreate.Output.Created.Body - ) { - self.headers = headers - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.IssuesCreate.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.IssuesCreate.Output.Created { - get throws { - switch self { - case let .created(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "created", - response: self - ) - } - } - } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Service unavailable - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. - /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self - ) - } - } + /// - Remark: Generated from `#/paths//orgs/{org}/issues/get(issues/list-for-org)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListForOrg.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.IssuesListForOrg.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/post(issues/create)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/issues/get(issues/list-for-org)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -13067,29 +12483,6 @@ public enum Operations { } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/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. @@ -13097,14 +12490,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -13115,45 +12505,33 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// List issue comments for a repository - /// - /// You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request. - /// - /// By default, issue comments are ordered by ascending ID. - /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// List assignees /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)`. - public enum IssuesListCommentsForRepo { - public static let id: Swift.String = "issues/list-comments-for-repo" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/assignees`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/get(issues/list-assignees)`. + public enum IssuesListAssignees { + public static let id: Swift.String = "issues/list-assignees" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/path/repo`. public var repo: Components.Parameters.Repo /// Creates a new `Path`. /// @@ -13168,74 +12546,43 @@ public enum Operations { self.repo = repo } } - public var path: Operations.IssuesListCommentsForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query`. + public var path: Operations.IssuesListAssignees.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/query`. public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/sort`. - @frozen public enum Sort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - } - /// The property to sort the results by. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/sort`. - public var sort: Components.Parameters.Sort? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/direction`. - @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// Either `asc` or `desc`. Ignored without the `sort` parameter. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/direction`. - public var direction: Operations.IssuesListCommentsForRepo.Input.Query.DirectionPayload? - /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/since`. - public var since: Components.Parameters.Since? /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: - /// - sort: The property to sort the results by. - /// - direction: Either `asc` or `desc`. Ignored without the `sort` parameter. - /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( - sort: Components.Parameters.Sort? = nil, - direction: Operations.IssuesListCommentsForRepo.Input.Query.DirectionPayload? = nil, - since: Components.Parameters.Since? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { - self.sort = sort - self.direction = direction - self.since = since self.perPage = perPage self.page = page } } - public var query: Operations.IssuesListCommentsForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/header`. + public var query: Operations.IssuesListAssignees.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListCommentsForRepo.Input.Headers + public var headers: Operations.IssuesListAssignees.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -13243,9 +12590,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.IssuesListCommentsForRepo.Input.Path, - query: Operations.IssuesListCommentsForRepo.Input.Query = .init(), - headers: Operations.IssuesListCommentsForRepo.Input.Headers = .init() + path: Operations.IssuesListAssignees.Input.Path, + query: Operations.IssuesListAssignees.Input.Query = .init(), + headers: Operations.IssuesListAssignees.Input.Headers = .init() ) { self.path = path self.query = query @@ -13254,9 +12601,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -13267,16 +12614,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesListCommentsForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/content`. + public var headers: Operations.IssuesListAssignees.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/content/application\/json`. - case json([Components.Schemas.IssueComment]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.IssueComment] { + public var json: [Components.Schemas.SimpleUser] { get throws { switch self { case let .json(body): @@ -13286,15 +12633,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListCommentsForRepo.Output.Ok.Body + public var body: Operations.IssuesListAssignees.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListCommentsForRepo.Output.Ok.Headers = .init(), - body: Operations.IssuesListCommentsForRepo.Output.Ok.Body + headers: Operations.IssuesListAssignees.Output.Ok.Headers = .init(), + body: Operations.IssuesListAssignees.Output.Ok.Body ) { self.headers = headers self.body = body @@ -13302,15 +12649,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/get(issues/list-assignees)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListCommentsForRepo.Output.Ok) + case ok(Operations.IssuesListAssignees.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.IssuesListCommentsForRepo.Output.Ok { + public var ok: Operations.IssuesListAssignees.Output.Ok { get throws { switch self { case let .ok(response): @@ -13323,32 +12670,9 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/get(issues/list-assignees)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -13400,89 +12724,119 @@ public enum Operations { } } } - /// Get an issue comment + /// Check if a user can be assigned /// - /// You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. + /// Checks if a user has permission to be assigned to an issue in this repository. /// - /// 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)." + /// If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. /// - /// - **`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`. + /// Otherwise a `404` status code is returned. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments/{comment_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/get(issues/get-comment)`. - public enum IssuesGetComment { - public static let id: Swift.String = "issues/get-comment" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/assignees/{assignee}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)`. + public enum IssuesCheckUserCanBeAssigned { + public static let id: Swift.String = "issues/check-user-can-be-assigned" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path/comment_id`. - public var commentId: Components.Parameters.CommentId + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/path/assignee`. + public var assignee: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. + /// - assignee: public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId + assignee: Swift.String ) { self.owner = owner self.repo = repo - self.commentId = commentId + self.assignee = assignee } } - public var path: Operations.IssuesGetComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/header`. + public var path: Operations.IssuesCheckUserCanBeAssigned.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesGetComment.Input.Headers + public var headers: Operations.IssuesCheckUserCanBeAssigned.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.IssuesGetComment.Input.Path, - headers: Operations.IssuesGetComment.Input.Headers = .init() + path: Operations.IssuesCheckUserCanBeAssigned.Input.Path, + headers: Operations.IssuesCheckUserCanBeAssigned.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/responses/200/content`. + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesCheckUserCanBeAssigned.Output.NoContent) + /// If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesCheckUserCanBeAssigned.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.IssueComment) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/assignees/{assignee}/GET/responses/404/content/application\/json`. + case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.IssueComment { + public var json: Components.Schemas.BasicError { get throws { switch self { case let .json(body): @@ -13492,49 +12846,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesGetComment.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.IssuesCheckUserCanBeAssigned.Output.NotFound.Body + /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesGetComment.Output.Ok.Body) { + public init(body: Operations.IssuesCheckUserCanBeAssigned.Output.NotFound.Body) { self.body = body } } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/get(issues/get-comment)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGetComment.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.IssuesGetComment.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Resource not found + /// Otherwise a `404` status code is returned. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/get(issues/get-comment)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/assignees/{assignee}/get(issues/check-user-can-be-assigned)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) + case notFound(Operations.IssuesCheckUserCanBeAssigned.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: Components.Responses.NotFound { + public var notFound: Operations.IssuesCheckUserCanBeAssigned.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -13578,9 +12909,12 @@ public enum Operations { } } } - /// Update an issue comment + /// List repository issues /// - /// You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. + /// List issues in a repository. Only open issues will be listed. + /// + /// > [!NOTE] + /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -13589,104 +12923,213 @@ public enum Operations { /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/patch(issues/update-comment)`. - public enum IssuesUpdateComment { - public static let id: Swift.String = "issues/update-comment" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)`. + public enum IssuesListForRepo { + public static let id: Swift.String = "issues/list-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/comments/{comment_id}/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/comments/{comment_id}/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/path/comment_id`. - public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.commentId = commentId } } - public var path: Operations.IssuesUpdateComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + public var path: Operations.IssuesListForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query`. + public struct Query: Sendable, Hashable { + /// If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/milestone`. + public var milestone: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + case all = "all" } - } - public var headers: Operations.IssuesUpdateComment.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The contents of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody/json/body`. - public var body: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - body: The contents of the comment. - public init(body: Swift.String) { - self.body = body - } - public enum CodingKeys: String, CodingKey { - case body - } + /// Indicates the state of the issues to return. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/state`. + public var state: Operations.IssuesListForRepo.Input.Query.StatePayload? + /// Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/assignee`. + public var assignee: Swift.String? + /// Can be the name of an issue type. If the string `*` is passed, issues with any type are accepted. If the string `none` is passed, issues without type are returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/type`. + public var _type: Swift.String? + /// The user that created the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/creator`. + public var creator: Swift.String? + /// A user that's mentioned in the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/mentioned`. + public var mentioned: Swift.String? + /// A comma-separated list of issue field filters in `field_slug:value` format. + /// Only issues matching all specified field values are returned. + /// Requires issue fields to be enabled for the repository. Issue fields are + /// not available for user-owned repositories, and field availability for + /// organization-owned public repositories depends on the organization's + /// visibility settings. For example, `priority:Urgent,severity:High` filters + /// issues where the `priority` field is `Urgent` AND the `severity` field is + /// `High`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/issue_field_values`. + public var issueFieldValues: Swift.String? + /// A list of comma separated label names. Example: `bug,ui,@high` + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/labels`. + public var labels: Components.Parameters.Labels? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/sort`. + @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case comments = "comments" + } + /// What to sort results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/sort`. + public var sort: Operations.IssuesListForRepo.Input.Query.SortPayload? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/since`. + public var since: Components.Parameters.Since? + /// 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/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - milestone: If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. + /// - state: Indicates the state of the issues to return. + /// - assignee: Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. + /// - _type: Can be the name of an issue type. If the string `*` is passed, issues with any type are accepted. If the string `none` is passed, issues without type are returned. + /// - creator: The user that created the issue. + /// - mentioned: A user that's mentioned in the issue. + /// - issueFieldValues: A comma-separated list of issue field filters in `field_slug:value` format. + /// - labels: A list of comma separated label names. Example: `bug,ui,@high` + /// - sort: What to sort results by. + /// - direction: The direction to sort the results by. + /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + milestone: Swift.String? = nil, + state: Operations.IssuesListForRepo.Input.Query.StatePayload? = nil, + assignee: Swift.String? = nil, + _type: Swift.String? = nil, + creator: Swift.String? = nil, + mentioned: Swift.String? = nil, + issueFieldValues: Swift.String? = nil, + labels: Components.Parameters.Labels? = nil, + sort: Operations.IssuesListForRepo.Input.Query.SortPayload? = nil, + direction: Components.Parameters.Direction? = nil, + since: Components.Parameters.Since? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.milestone = milestone + self.state = state + self.assignee = assignee + self._type = _type + self.creator = creator + self.mentioned = mentioned + self.issueFieldValues = issueFieldValues + self.labels = labels + self.sort = sort + self.direction = direction + self.since = since + self.perPage = perPage + self.page = page } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody/content/application\/json`. - case json(Operations.IssuesUpdateComment.Input.Body.JsonPayload) } - public var body: Operations.IssuesUpdateComment.Input.Body + public var query: Operations.IssuesListForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesListForRepo.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesUpdateComment.Input.Path, - headers: Operations.IssuesUpdateComment.Input.Headers = .init(), - body: Operations.IssuesUpdateComment.Input.Body + path: Operations.IssuesListForRepo.Input.Path, + query: Operations.IssuesListForRepo.Input.Query = .init(), + headers: Operations.IssuesListForRepo.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesListForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.IssueComment) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssueComment { + public var json: [Components.Schemas.Issue] { get throws { switch self { case let .json(body): @@ -13696,26 +13139,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesUpdateComment.Output.Ok.Body + public var body: Operations.IssuesListForRepo.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.IssuesUpdateComment.Output.Ok.Body) { + public init( + headers: Operations.IssuesListForRepo.Output.Ok.Headers = .init(), + body: Operations.IssuesListForRepo.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/patch(issues/update-comment)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesUpdateComment.Output.Ok) + case ok(Operations.IssuesListForRepo.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.IssuesUpdateComment.Output.Ok { + public var ok: Operations.IssuesListForRepo.Output.Ok { get throws { switch self { case let .ok(response): @@ -13728,9 +13176,32 @@ public enum Operations { } } } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/patch(issues/update-comment)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -13751,6 +13222,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/get(issues/list-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -13782,99 +13276,12 @@ public enum Operations { } } } - /// Delete an issue comment + /// Create an issue /// - /// You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. + /// Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/delete(issues/delete-comment)`. - public enum IssuesDeleteComment { - public static let id: Swift.String = "issues/delete-comment" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path/comment_id`. - public var commentId: Components.Parameters.CommentId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId - ) { - self.owner = owner - self.repo = repo - self.commentId = commentId - } - } - public var path: Operations.IssuesDeleteComment.Input.Path - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - public init(path: Operations.IssuesDeleteComment.Input.Path) { - self.path = path - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/delete(issues/delete-comment)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesDeleteComment.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/delete(issues/delete-comment)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesDeleteComment.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - } - /// Pin an issue comment - /// - /// You can use the REST API to pin comments on issues. + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -13883,206 +13290,495 @@ public enum Operations { /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)`. - public enum IssuesPinComment { - public static let id: Swift.String = "issues/pin-comment" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)`. + public enum IssuesCreate { + public static let id: Swift.String = "issues/create" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/comments/{comment_id}/pin/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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/comments/{comment_id}/pin/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path/comment_id`. - public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.commentId = commentId } } - public var path: Operations.IssuesPinComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/header`. + public var path: Operations.IssuesCreate.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesPinComment.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.IssuesPinComment.Input.Path, - headers: Operations.IssuesPinComment.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.IssueComment) - /// The associated value of the enum case if `self` is `.json`. + public var headers: Operations.IssuesCreate.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The title of the issue. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.IssueComment { - get throws { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title`. + @frozen public enum TitlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title/case2`. + case case2(Swift.Int) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { switch self { - case let .json(body): - return body + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) } } } - } - /// Received HTTP response body - public var body: Operations.IssuesPinComment.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesPinComment.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesPinComment.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. - /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesPinComment.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) + /// The title of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/title`. + public var title: Operations.IssuesCreate.Input.Body.JsonPayload.TitlePayload + /// The contents of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/body`. + public var body: Swift.String? + /// Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is closing down.**_ + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/assignee`. + public var assignee: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone`. + @frozen public enum MilestonePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone/case1`. + case case1(Swift.String) + /// The `number` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._ + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone/case2`. + case case2(Swift.Int) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } } - } - } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/milestone`. + public var milestone: Operations.IssuesCreate.Input.Body.JsonPayload.MilestonePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload`. + @frozen public enum LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2/color`. + public var color: Swift.String? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - color: + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + description: Swift.String? = nil, + color: Swift.String? = nil + ) { + self.id = id + self.name = name + self.description = description + self.color = color + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case color + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/LabelsPayload/case2`. + case case2(Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/labels`. + public typealias LabelsPayload = [Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayloadPayload] + /// Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/labels`. + public var labels: Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayload? + /// Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/assignees`. + public var assignees: [Swift.String]? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field. For multi-select fields, provide an array of option names. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value/case3`. + case case3([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field. For multi-select fields, provide an array of option names. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field. For multi-select fields, provide an array of option names. + public init( + fieldId: Swift.Int, + value: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + ) { + self.fieldId = fieldId + self.value = value + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value" + ]) + } + } + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayload? + /// The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/json/type`. + public var _type: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - title: The title of the issue. + /// - body: The contents of the issue. + /// - assignee: Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is closing down.**_ + /// - milestone: + /// - labels: Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ + /// - assignees: Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ + /// - issueFieldValues: An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise. + /// - _type: The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._ + public init( + title: Operations.IssuesCreate.Input.Body.JsonPayload.TitlePayload, + body: Swift.String? = nil, + assignee: Swift.String? = nil, + milestone: Operations.IssuesCreate.Input.Body.JsonPayload.MilestonePayload? = nil, + labels: Operations.IssuesCreate.Input.Body.JsonPayload.LabelsPayload? = nil, + assignees: [Swift.String]? = nil, + issueFieldValues: Operations.IssuesCreate.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil, + _type: Swift.String? = nil + ) { + self.title = title + self.body = body + self.assignee = assignee + self.milestone = milestone + self.labels = labels + self.assignees = assignees + self.issueFieldValues = issueFieldValues + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case title + case body + case assignee + case milestone + case labels + case assignees + case issueFieldValues = "issue_field_values" + case _type = "type" } } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/requestBody/content/application\/json`. + case json(Operations.IssuesCreate.Input.Body.JsonPayload) } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + public var body: Operations.IssuesCreate.Input.Body + /// Creates a new `Input`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesCreate.Input.Path, + headers: Operations.IssuesCreate.Input.Headers = .init(), + body: Operations.IssuesCreate.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/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesCreate.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/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.IssuesCreate.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesCreate.Output.Created.Headers = .init(), + body: Operations.IssuesCreate.Output.Created.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.IssuesCreate.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.IssuesCreate.Output.Created { + get throws { switch self { - case let .forbidden(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "created", response: self ) } } } - /// Resource not found + /// Bad Request /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/400`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .notFound(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "badRequest", response: self ) } } } - /// Gone + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/403`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .gone(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "forbidden", response: self ) } @@ -14090,7 +13786,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -14111,6 +13807,75 @@ public enum Operations { } } } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/post(issues/create)/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. @@ -14118,11 +13883,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -14133,157 +13901,232 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Unpin an issue comment + /// List issue comments for a repository /// - /// You can use the REST API to unpin comments on issues. + /// You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)`. - public enum IssuesUnpinComment { - public static let id: Swift.String = "issues/unpin-comment" + /// By default, issue comments are ordered by ascending ID. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)`. + public enum IssuesListCommentsForRepo { + public static let id: Swift.String = "issues/list-comments-for-repo" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/path/repo`. public var repo: Components.Parameters.Repo - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/comment_id`. - public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - commentId: Components.Parameters.CommentId + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.commentId = commentId } } - public var path: Operations.IssuesUnpinComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + public var path: Operations.IssuesListCommentsForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/components/parameters/sort`. + @frozen public enum Sort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" } - } - public var headers: Operations.IssuesUnpinComment.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/sort`. + public var sort: Components.Parameters.Sort? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/direction`. + @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// Either `asc` or `desc`. Ignored without the `sort` parameter. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/direction`. + public var direction: Operations.IssuesListCommentsForRepo.Input.Query.DirectionPayload? + /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/since`. + public var since: Components.Parameters.Since? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - sort: The property to sort the results by. + /// - direction: Either `asc` or `desc`. Ignored without the `sort` parameter. + /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + sort: Components.Parameters.Sort? = nil, + direction: Operations.IssuesListCommentsForRepo.Input.Query.DirectionPayload? = nil, + since: Components.Parameters.Since? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.sort = sort + self.direction = direction + self.since = since + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListCommentsForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesListCommentsForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: /// - headers: public init( - path: Operations.IssuesUnpinComment.Input.Path, - headers: Operations.IssuesUnpinComment.Input.Headers = .init() + path: Operations.IssuesListCommentsForRepo.Input.Path, + query: Operations.IssuesListCommentsForRepo.Input.Query = .init(), + headers: Operations.IssuesListCommentsForRepo.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesUnpinComment.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesUnpinComment.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesListCommentsForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueComment]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.IssueComment] { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.IssuesListCommentsForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListCommentsForRepo.Output.Ok.Headers = .init(), + body: Operations.IssuesListCommentsForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - /// Requires authentication + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/401`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)/responses/200`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListCommentsForRepo.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListCommentsForRepo.Output.Ok { get throws { switch self { - case let .unauthorized(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "ok", response: self ) } } } - /// Forbidden + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)/responses/422`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .forbidden(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "unprocessableContent", response: self ) } @@ -14291,7 +14134,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/get(issues/list-comments-for-repo)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -14312,52 +14155,6 @@ public enum Operations { } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } - /// Service unavailable - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. - /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -14389,116 +14186,89 @@ public enum Operations { } } } - /// List issue events for a repository + /// Get an issue comment /// - /// Lists events for a repository. + /// You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)`. - public enum IssuesListEventsForRepo { - public static let id: Swift.String = "issues/list-events-for-repo" + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/comments/{comment_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/get(issues/get-comment)`. + public enum IssuesGetComment { + public static let id: Swift.String = "issues/get-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path/repo`. public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId ) { self.owner = owner self.repo = repo + self.commentId = commentId } } - public var path: Operations.IssuesListEventsForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.IssuesListEventsForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/header`. + public var path: Operations.IssuesGetComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListEventsForRepo.Input.Headers + public var headers: Operations.IssuesGetComment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.IssuesListEventsForRepo.Input.Path, - query: Operations.IssuesListEventsForRepo.Input.Query = .init(), - headers: Operations.IssuesListEventsForRepo.Input.Headers = .init() + path: Operations.IssuesGetComment.Input.Path, + headers: Operations.IssuesGetComment.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.IssuesListEventsForRepo.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content/application\/json`. - case json([Components.Schemas.IssueEvent]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.IssueComment) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.IssueEvent] { + public var json: Components.Schemas.IssueComment { get throws { switch self { case let .json(body): @@ -14508,31 +14278,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListEventsForRepo.Output.Ok.Body + public var body: Operations.IssuesGetComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListEventsForRepo.Output.Ok.Headers = .init(), - body: Operations.IssuesListEventsForRepo.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.IssuesGetComment.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/get(issues/get-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListEventsForRepo.Output.Ok) + case ok(Operations.IssuesGetComment.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesListEventsForRepo.Output.Ok { + public var ok: Operations.IssuesGetComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -14545,24 +14310,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/get(issues/get-comment)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } @@ -14599,80 +14364,115 @@ public enum Operations { } } } - /// Get an issue event + /// Update an issue comment /// - /// Gets a single event by the event id. + /// You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events/{event_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)`. - public enum IssuesGetEvent { - public static let id: Swift.String = "issues/get-event" + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/patch(issues/update-comment)`. + public enum IssuesUpdateComment { + public static let id: Swift.String = "issues/update-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/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/events/{event_id}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/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/events/{event_id}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/path/repo`. public var repo: Components.Parameters.Repo - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/event_id`. - public var eventId: Swift.Int + /// The unique identifier of the comment. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - eventId: + /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - eventId: Swift.Int + commentId: Components.Parameters.CommentId ) { self.owner = owner self.repo = repo - self.eventId = eventId + self.commentId = commentId } } - public var path: Operations.IssuesGetEvent.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/header`. + public var path: Operations.IssuesUpdateComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesGetEvent.Input.Headers + public var headers: Operations.IssuesUpdateComment.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The contents of the comment. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody/json/body`. + public var body: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - body: The contents of the comment. + public init(body: Swift.String) { + self.body = body + } + public enum CodingKeys: String, CodingKey { + case body + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/requestBody/content/application\/json`. + case json(Operations.IssuesUpdateComment.Input.Body.JsonPayload) + } + public var body: Operations.IssuesUpdateComment.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.IssuesGetEvent.Input.Path, - headers: Operations.IssuesGetEvent.Input.Headers = .init() + path: Operations.IssuesUpdateComment.Input.Path, + headers: Operations.IssuesUpdateComment.Input.Headers = .init(), + body: Operations.IssuesUpdateComment.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/events/{event_id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.IssueEvent) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.IssueComment) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.IssueEvent { + public var json: Components.Schemas.IssueComment { get throws { switch self { case let .json(body): @@ -14682,26 +14482,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesGetEvent.Output.Ok.Body + public var body: Operations.IssuesUpdateComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesGetEvent.Output.Ok.Body) { + public init(body: Operations.IssuesUpdateComment.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/patch(issues/update-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGetEvent.Output.Ok) + case ok(Operations.IssuesUpdateComment.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesGetEvent.Output.Ok { + public var ok: Operations.IssuesUpdateComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -14714,76 +14514,30 @@ public enum Operations { } } } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } - /// Gone + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/patch(issues/update-comment)/responses/422`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .gone(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } - /// Undocumented response. + /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) @@ -14814,17 +14568,99 @@ public enum Operations { } } } - /// Get an issue + /// Delete an issue comment /// - /// The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was - /// [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If - /// the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API - /// returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read - /// access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe - /// to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. + /// You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. /// - /// > [!NOTE] - /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/delete(issues/delete-comment)`. + public enum IssuesDeleteComment { + public static let id: Swift.String = "issues/delete-comment" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The unique identifier of the comment. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/DELETE/path/comment_id`. + public var commentId: Components.Parameters.CommentId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - commentId: The unique identifier of the comment. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + commentId: Components.Parameters.CommentId + ) { + self.owner = owner + self.repo = repo + self.commentId = commentId + } + } + public var path: Operations.IssuesDeleteComment.Input.Path + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + public init(path: Operations.IssuesDeleteComment.Input.Path) { + self.path = path + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/delete(issues/delete-comment)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesDeleteComment.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/delete(issues/delete-comment)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesDeleteComment.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + } + /// Pin an issue comment + /// + /// You can use the REST API to pin comments on issues. /// /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." /// @@ -14833,62 +14669,62 @@ public enum Operations { /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)`. - public enum IssuesGet { - public static let id: Swift.String = "issues/get" + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)`. + public enum IssuesPinComment { + public static let id: Swift.String = "issues/pin-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the issue. + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. + /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + commentId: Components.Parameters.CommentId ) { self.owner = owner self.repo = repo - self.issueNumber = issueNumber + self.commentId = commentId } } - public var path: Operations.IssuesGet.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/header`. + public var path: Operations.IssuesPinComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesGet.Input.Headers + public var headers: Operations.IssuesPinComment.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.IssuesGet.Input.Path, - headers: Operations.IssuesGet.Input.Headers = .init() + path: Operations.IssuesPinComment.Input.Path, + headers: Operations.IssuesPinComment.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -14896,15 +14732,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Issue) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.IssueComment) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { + public var json: Components.Schemas.IssueComment { get throws { switch self { case let .json(body): @@ -14914,26 +14750,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesGet.Output.Ok.Body + public var body: Operations.IssuesPinComment.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesGet.Output.Ok.Body) { + public init(body: Operations.IssuesPinComment.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGet.Output.Ok) + case ok(Operations.IssuesPinComment.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesGet.Output.Ok { + public var ok: Operations.IssuesPinComment.Output.Ok { get throws { switch self { case let .ok(response): @@ -14946,24 +14782,47 @@ public enum Operations { } } } - /// Moved permanently + /// Requires authentication /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/401`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. /// - /// - Throws: An error if `self` is not `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { get throws { switch self { - case let .movedPermanently(response): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", response: self ) } @@ -14971,7 +14830,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -14994,7 +14853,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -15015,32 +14874,24 @@ public enum Operations { } } } - /// Not modified - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/put(issues/pin-comment)/responses/422`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notModified(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "unprocessableContent", response: self ) } @@ -15077,222 +14928,1531 @@ public enum Operations { } } } - /// Update an issue + /// Unpin an issue comment /// - /// Issue owners and users with push access or Triage role can edit an issue. + /// You can use the REST API to unpin comments on issues. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." - /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. - /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)`. - public enum IssuesUpdate { - public static let id: Swift.String = "issues/update" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)`. + public enum IssuesUnpinComment { + public static let id: Swift.String = "issues/unpin-comment" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies the issue. + /// The unique identifier of the comment. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/path/comment_id`. + public var commentId: Components.Parameters.CommentId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. + /// - commentId: The unique identifier of the comment. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + commentId: Components.Parameters.CommentId ) { self.owner = owner self.repo = repo - self.issueNumber = issueNumber + self.commentId = commentId } } - public var path: Operations.IssuesUpdate.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/header`. + public var path: Operations.IssuesUnpinComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/comments/{comment_id}/pin/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesUpdate.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The title of the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title`. - @frozen public enum TitlePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title/case2`. - case case2(Swift.Int) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The title of the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title`. - public var title: Operations.IssuesUpdate.Input.Body.JsonPayload.TitlePayload? - /// The contents of the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/body`. - public var body: Swift.String? - /// Username to assign to this issue. **This field is closing down.** - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignee`. - public var assignee: Swift.String? - /// The open or closed state of the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case closed = "closed" + public var headers: Operations.IssuesUnpinComment.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesUnpinComment.Input.Path, + headers: Operations.IssuesUnpinComment.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesUnpinComment.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesUnpinComment.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } - /// The open or closed state of the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state`. - public var state: Operations.IssuesUpdate.Input.Body.JsonPayload.StatePayload? - /// The reason for the state change. Ignored unless `state` is changed. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state_reason`. - @frozen public enum StateReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { - case completed = "completed" - case notPlanned = "not_planned" - case duplicate = "duplicate" - case reopened = "reopened" + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) } - /// The reason for the state change. Ignored unless `state` is changed. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state_reason`. - public var stateReason: Operations.IssuesUpdate.Input.Body.JsonPayload.StateReasonPayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone`. - @frozen public enum MilestonePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone/case1`. - case case1(Swift.String) - /// The `number` of the milestone to associate this issue with or use `null` to remove the current milestone. Only users with push access can set the milestone for issues. Without push access to the repository, milestone changes are silently dropped. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone/case2`. - case case2(Swift.Int) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - } - } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone`. - public var milestone: Operations.IssuesUpdate.Input.Body.JsonPayload.MilestonePayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload`. - @frozen public enum LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2`. - public struct Case2Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/id`. - public var id: Swift.Int? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/description`. + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/comments/{comment_id}/pin/delete(issues/unpin-comment)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case 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 issue events for a repository + /// + /// Lists events for a repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)`. + public enum IssuesListEventsForRepo { + public static let id: Swift.String = "issues/list-events-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/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.IssuesListEventsForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListEventsForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesListEventsForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.IssuesListEventsForRepo.Input.Path, + query: Operations.IssuesListEventsForRepo.Input.Query = .init(), + headers: Operations.IssuesListEventsForRepo.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesListEventsForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueEvent]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.IssueEvent] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListEventsForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListEventsForRepo.Output.Ok.Headers = .init(), + body: Operations.IssuesListEventsForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListEventsForRepo.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListEventsForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/get(issues/list-events-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an issue event + /// + /// Gets a single event by the event id. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/events/{event_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)`. + public enum IssuesGetEvent { + public static let id: Swift.String = "issues/get-event" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/path/event_id`. + public var eventId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - eventId: + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + eventId: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.eventId = eventId + } + } + public var path: Operations.IssuesGetEvent.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesGetEvent.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesGetEvent.Input.Path, + headers: Operations.IssuesGetEvent.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/events/{event_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.IssueEvent) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.IssueEvent { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesGetEvent.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesGetEvent.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesGetEvent.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesGetEvent.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/events/{event_id}/get(issues/get-event)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get an issue + /// + /// The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was + /// [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If + /// the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API + /// returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read + /// access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe + /// to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. + /// + /// > [!NOTE] + /// > GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)`. + public enum IssuesGet { + public static let id: Swift.String = "issues/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesGet.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/header`. + public 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.IssuesGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesGet.Input.Path, + headers: Operations.IssuesGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Issue { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesGet.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesGet.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesGet.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/get(issues/get)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update an issue + /// + /// Issue owners and users with push access or Triage role can edit an issue. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)`. + public enum IssuesUpdate { + public static let id: Swift.String = "issues/update" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesUpdate.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesUpdate.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The title of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title`. + @frozen public enum TitlePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title/case2`. + case case2(Swift.Int) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The title of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/title`. + public var title: Operations.IssuesUpdate.Input.Body.JsonPayload.TitlePayload? + /// The contents of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/body`. + public var body: Swift.String? + /// Username to assign to this issue. **This field is closing down.** + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignee`. + public var assignee: Swift.String? + /// The open or closed state of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// The open or closed state of the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state`. + public var state: Operations.IssuesUpdate.Input.Body.JsonPayload.StatePayload? + /// The reason for the state change. Ignored unless `state` is changed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state_reason`. + @frozen public enum StateReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { + case completed = "completed" + case notPlanned = "not_planned" + case duplicate = "duplicate" + case reopened = "reopened" + } + /// The reason for the state change. Ignored unless `state` is changed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/state_reason`. + public var stateReason: Operations.IssuesUpdate.Input.Body.JsonPayload.StateReasonPayload? + /// The ID of the issue to mark as the canonical duplicate when `state_reason` is `duplicate`. The issue must exist and be accessible to the authenticated user. Ignored when `state_reason` is not `duplicate`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/duplicate_issue_id`. + public var duplicateIssueId: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone`. + @frozen public enum MilestonePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone/case1`. + case case1(Swift.String) + /// The `number` of the milestone to associate this issue with or use `null` to remove the current milestone. Only users with push access can set the milestone for issues. Without push access to the repository, milestone changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone/case2`. + case case2(Swift.Int) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/milestone`. + public var milestone: Operations.IssuesUpdate.Input.Body.JsonPayload.MilestonePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload`. + @frozen public enum LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/id`. + public var id: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/description`. public var description: Swift.String? /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/color`. public var color: Swift.String? + /// Optional reasoning for selecting this label. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/rationale`. + public var rationale: Swift.String? + /// If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/suggest`. + public var suggest: Swift.Bool? + /// The confidence level for this label choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// The confidence level for this label choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2/confidence`. + public var confidence: Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload.ConfidencePayload? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - id: + /// - name: + /// - description: + /// - color: + /// - rationale: Optional reasoning for selecting this label. + /// - suggest: If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// - confidence: The confidence level for this label choice. + public init( + id: Swift.Int? = nil, + name: Swift.String? = nil, + description: Swift.String? = nil, + color: Swift.String? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload.ConfidencePayload? = nil + ) { + self.id = id + self.name = name + self.description = description + self.color = color + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + } + public enum CodingKeys: String, CodingKey { + case id + case name + case description + case color + case rationale + case suggest + case confidence + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2`. + case case2(Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/labels`. + public typealias LabelsPayload = [Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayloadPayload] + /// Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/labels`. + public var labels: Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload`. + @frozen public enum AssigneesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2/login`. + public var login: Swift.String? + /// Optional reasoning for selecting this assignee. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2/rationale`. + public var rationale: Swift.String? + /// If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2/suggest`. + public var suggest: Swift.Bool? + /// The confidence level for this assignee choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// The confidence level for this assignee choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2/confidence`. + public var confidence: Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayloadPayload.Case2Payload.ConfidencePayload? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - login: + /// - rationale: Optional reasoning for selecting this assignee. + /// - suggest: If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// - confidence: The confidence level for this assignee choice. + public init( + login: Swift.String? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayloadPayload.Case2Payload.ConfidencePayload? = nil + ) { + self.login = login + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + } + public enum CodingKeys: String, CodingKey { + case login + case rationale + case suggest + case confidence + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2`. + case case2(Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayloadPayload.Case2Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignees`. + public typealias AssigneesPayload = [Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayloadPayload] + /// Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignees`. + public var assignees: Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field. For multi-select fields, provide an array of option names. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case3`. + case case3([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field. For multi-select fields, provide an array of option names. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Optional reasoning for setting this field value. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/rationale`. + public var rationale: Swift.String? + /// If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/suggest`. + public var suggest: Swift.Bool? + /// The confidence level for this field value choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// The confidence level for this field value choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/confidence`. + public var confidence: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ConfidencePayload? + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field. For multi-select fields, provide an array of option names. + /// - rationale: Optional reasoning for setting this field value. + /// - suggest: If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// - confidence: The confidence level for this field value choice. + public init( + fieldId: Swift.Int, + value: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ConfidencePayload? = nil + ) { + self.fieldId = fieldId + self.value = value + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + case rationale + case suggest + case confidence + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + self.rationale = try container.decodeIfPresent( + Swift.String.self, + forKey: .rationale + ) + self.suggest = try container.decodeIfPresent( + Swift.Bool.self, + forKey: .suggest + ) + self.confidence = try container.decodeIfPresent( + Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ConfidencePayload.self, + forKey: .confidence + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value", + "rationale", + "suggest", + "confidence" + ]) + } + } + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayload? + /// The issue type to associate with this issue. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type`. + @frozen public enum _TypePayload: Codable, Hashable, Sendable { + /// The name of the issue type. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case1`. + case case1(Swift.String) + /// The issue type with optional metadata. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// The name of the issue type to associate with this issue, or `null` to remove the current issue type. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case2/value`. + public var value: Swift.String? + /// Optional reasoning for selecting this type. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case2/rationale`. + public var rationale: Swift.String? + /// If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case2/suggest`. + public var suggest: Swift.Bool? + /// The confidence level for this type choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case2/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// The confidence level for this type choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case2/confidence`. + public var confidence: Operations.IssuesUpdate.Input.Body.JsonPayload._TypePayload.Case2Payload.ConfidencePayload? /// Creates a new `Case2Payload`. /// /// - Parameters: - /// - id: - /// - name: - /// - description: - /// - color: + /// - value: The name of the issue type to associate with this issue, or `null` to remove the current issue type. + /// - rationale: Optional reasoning for selecting this type. + /// - suggest: If `true`, the change is stored as a pending suggestion for human review rather than applied directly. + /// - confidence: The confidence level for this type choice. public init( - id: Swift.Int? = nil, - name: Swift.String? = nil, - description: Swift.String? = nil, - color: Swift.String? = nil + value: Swift.String? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Input.Body.JsonPayload._TypePayload.Case2Payload.ConfidencePayload? = nil ) { - self.id = id - self.name = name - self.description = description - self.color = color + self.value = value + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence } public enum CodingKeys: String, CodingKey { - case id - case name - case description - case color + case value + case rationale + case suggest + case confidence } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/LabelsPayload/case2`. - case case2(Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayloadPayload.Case2Payload) + /// The issue type with optional metadata. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type/case2`. + case case2(Operations.IssuesUpdate.Input.Body.JsonPayload._TypePayload.Case2Payload) public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] do { @@ -15322,35 +16482,826 @@ public enum Operations { } } } - /// Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/labels`. - public typealias LabelsPayload = [Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayloadPayload] - /// Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/labels`. - public var labels: Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload`. + /// The issue type to associate with this issue. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type`. + public var _type: Operations.IssuesUpdate.Input.Body.JsonPayload._TypePayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - title: The title of the issue. + /// - body: The contents of the issue. + /// - assignee: Username to assign to this issue. **This field is closing down.** + /// - state: The open or closed state of the issue. + /// - stateReason: The reason for the state change. Ignored unless `state` is changed. + /// - duplicateIssueId: The ID of the issue to mark as the canonical duplicate when `state_reason` is `duplicate`. The issue must exist and be accessible to the authenticated user. Ignored when `state_reason` is not `duplicate`. + /// - milestone: + /// - labels: Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. + /// - assignees: Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// - issueFieldValues: An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues + /// - _type: The issue type to associate with this issue. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. + public init( + title: Operations.IssuesUpdate.Input.Body.JsonPayload.TitlePayload? = nil, + body: Swift.String? = nil, + assignee: Swift.String? = nil, + state: Operations.IssuesUpdate.Input.Body.JsonPayload.StatePayload? = nil, + stateReason: Operations.IssuesUpdate.Input.Body.JsonPayload.StateReasonPayload? = nil, + duplicateIssueId: Swift.Int? = nil, + milestone: Operations.IssuesUpdate.Input.Body.JsonPayload.MilestonePayload? = nil, + labels: Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayload? = nil, + assignees: Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayload? = nil, + issueFieldValues: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil, + _type: Operations.IssuesUpdate.Input.Body.JsonPayload._TypePayload? = nil + ) { + self.title = title + self.body = body + self.assignee = assignee + self.state = state + self.stateReason = stateReason + self.duplicateIssueId = duplicateIssueId + self.milestone = milestone + self.labels = labels + self.assignees = assignees + self.issueFieldValues = issueFieldValues + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case title + case body + case assignee + case state + case stateReason = "state_reason" + case duplicateIssueId = "duplicate_issue_id" + case milestone + case labels + case assignees + case issueFieldValues = "issue_field_values" + case _type = "type" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/content/application\/json`. + case json(Operations.IssuesUpdate.Input.Body.JsonPayload) + } + public var body: Operations.IssuesUpdate.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesUpdate.Input.Path, + headers: Operations.IssuesUpdate.Input.Headers = .init(), + body: Operations.IssuesUpdate.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value1`. + public var value1: Components.Schemas.Issue + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Pending suggestions for each suggestible field (`type`, + /// `issue_field_values`, `labels`, `assignees`, `state`) the + /// request touched. Omitted for fields not in the request or + /// with no pending suggestions. Items tagged `already_applied` + /// are echoes of the current request's inputs whose target is + /// already applied to the issue; they are not persisted as + /// pending suggestions. + /// + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions`. + public struct SuggestionsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/_TypePayload`. + public struct _TypePayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/_TypePayload/value`. + public var value: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/_TypePayload/rationale`. + public var rationale: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/_TypePayload/suggest`. + public var suggest: Swift.Bool? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/_TypePayload/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/_TypePayload/confidence`. + public var confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload._TypePayloadPayload.ConfidencePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/_TypePayload/already_applied`. + public var alreadyApplied: Swift.Bool? + /// Creates a new `_TypePayloadPayload`. + /// + /// - Parameters: + /// - value: + /// - rationale: + /// - suggest: + /// - confidence: + /// - alreadyApplied: + public init( + value: Swift.String? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload._TypePayloadPayload.ConfidencePayload? = nil, + alreadyApplied: Swift.Bool? = nil + ) { + self.value = value + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + self.alreadyApplied = alreadyApplied + } + public enum CodingKeys: String, CodingKey { + case value + case rationale + case suggest + case confidence + case alreadyApplied = "already_applied" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/type`. + public typealias _TypePayload = [Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload._TypePayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/type`. + public var _type: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload._TypePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/value/case3`. + case case3([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.IssueFieldValuesPayloadPayload.ValuePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/rationale`. + public var rationale: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/suggest`. + public var suggest: Swift.Bool? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/confidence`. + public var confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.IssueFieldValuesPayloadPayload.ConfidencePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/IssueFieldValuesPayload/already_applied`. + public var alreadyApplied: Swift.Bool? + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: + /// - value: + /// - rationale: + /// - suggest: + /// - confidence: + /// - alreadyApplied: + public init( + fieldId: Swift.Int? = nil, + value: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.IssueFieldValuesPayloadPayload.ValuePayload? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.IssueFieldValuesPayloadPayload.ConfidencePayload? = nil, + alreadyApplied: Swift.Bool? = nil + ) { + self.fieldId = fieldId + self.value = value + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + self.alreadyApplied = alreadyApplied + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + case rationale + case suggest + case confidence + case alreadyApplied = "already_applied" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.IssueFieldValuesPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/issue_field_values`. + public var issueFieldValues: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.IssueFieldValuesPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/LabelsPayload/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/LabelsPayload/rationale`. + public var rationale: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/LabelsPayload/suggest`. + public var suggest: Swift.Bool? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/LabelsPayload/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/LabelsPayload/confidence`. + public var confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.LabelsPayloadPayload.ConfidencePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/LabelsPayload/already_applied`. + public var alreadyApplied: Swift.Bool? + /// Creates a new `LabelsPayloadPayload`. + /// + /// - Parameters: + /// - name: + /// - rationale: + /// - suggest: + /// - confidence: + /// - alreadyApplied: + public init( + name: Swift.String? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.LabelsPayloadPayload.ConfidencePayload? = nil, + alreadyApplied: Swift.Bool? = nil + ) { + self.name = name + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + self.alreadyApplied = alreadyApplied + } + public enum CodingKeys: String, CodingKey { + case name + case rationale + case suggest + case confidence + case alreadyApplied = "already_applied" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/labels`. + public typealias LabelsPayload = [Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.LabelsPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/labels`. + public var labels: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.LabelsPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/AssigneesPayload`. + public struct AssigneesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/AssigneesPayload/login`. + public var login: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/AssigneesPayload/rationale`. + public var rationale: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/AssigneesPayload/suggest`. + public var suggest: Swift.Bool? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/AssigneesPayload/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/AssigneesPayload/confidence`. + public var confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.AssigneesPayloadPayload.ConfidencePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/AssigneesPayload/already_applied`. + public var alreadyApplied: Swift.Bool? + /// Creates a new `AssigneesPayloadPayload`. + /// + /// - Parameters: + /// - login: + /// - rationale: + /// - suggest: + /// - confidence: + /// - alreadyApplied: + public init( + login: Swift.String? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.AssigneesPayloadPayload.ConfidencePayload? = nil, + alreadyApplied: Swift.Bool? = nil + ) { + self.login = login + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + self.alreadyApplied = alreadyApplied + } + public enum CodingKeys: String, CodingKey { + case login + case rationale + case suggest + case confidence + case alreadyApplied = "already_applied" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/assignees`. + public typealias AssigneesPayload = [Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.AssigneesPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/assignees`. + public var assignees: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.AssigneesPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload`. + public struct StatePayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/value`. + public var value: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/state_reason`. + public var stateReason: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/duplicate_issue_id`. + public var duplicateIssueId: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/rationale`. + public var rationale: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/suggest`. + public var suggest: Swift.Bool? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/confidence`. + public var confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.StatePayloadPayload.ConfidencePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/StatePayload/already_applied`. + public var alreadyApplied: Swift.Bool? + /// Creates a new `StatePayloadPayload`. + /// + /// - Parameters: + /// - value: + /// - stateReason: + /// - duplicateIssueId: + /// - rationale: + /// - suggest: + /// - confidence: + /// - alreadyApplied: + public init( + value: Swift.String? = nil, + stateReason: Swift.String? = nil, + duplicateIssueId: Swift.Int? = nil, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.StatePayloadPayload.ConfidencePayload? = nil, + alreadyApplied: Swift.Bool? = nil + ) { + self.value = value + self.stateReason = stateReason + self.duplicateIssueId = duplicateIssueId + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + self.alreadyApplied = alreadyApplied + } + public enum CodingKeys: String, CodingKey { + case value + case stateReason = "state_reason" + case duplicateIssueId = "duplicate_issue_id" + case rationale + case suggest + case confidence + case alreadyApplied = "already_applied" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/state`. + public typealias StatePayload = [Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.StatePayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions/state`. + public var state: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.StatePayload? + /// Creates a new `SuggestionsPayload`. + /// + /// - Parameters: + /// - _type: + /// - issueFieldValues: + /// - labels: + /// - assignees: + /// - state: + public init( + _type: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload._TypePayload? = nil, + issueFieldValues: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.IssueFieldValuesPayload? = nil, + labels: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.LabelsPayload? = nil, + assignees: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.AssigneesPayload? = nil, + state: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload.StatePayload? = nil + ) { + self._type = _type + self.issueFieldValues = issueFieldValues + self.labels = labels + self.assignees = assignees + self.state = state + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case issueFieldValues = "issue_field_values" + case labels + case assignees + case state + } + } + /// Pending suggestions for each suggestible field (`type`, + /// `issue_field_values`, `labels`, `assignees`, `state`) the + /// request touched. Omitted for fields not in the request or + /// with no pending suggestions. Items tagged `already_applied` + /// are echoes of the current request's inputs whose target is + /// already applied to the issue; they are not persisted as + /// pending suggestions. + /// + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2/suggestions`. + public var suggestions: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - suggestions: Pending suggestions for each suggestible field (`type`, + public init(suggestions: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload.SuggestionsPayload? = nil) { + self.suggestions = suggestions + } + public enum CodingKeys: String, CodingKey { + case suggestions + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2`. + public var value2: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.Issue, + value2: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/application\/json`. + case json(Operations.IssuesUpdate.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesUpdate.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesUpdate.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesUpdate.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.IssuesUpdate.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. + /// + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { + get throws { + switch self { + case let .gone(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "gone", + response: self + ) + } + } + } + /// 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 assignees to an issue + /// + /// Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/assignees`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/post(issues/add-assignees)`. + public enum IssuesAddAssignees { + public static let id: Swift.String = "issues/add-assignees" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/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}/assignees/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}/assignees/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}/assignees/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesAddAssignees.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/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.IssuesAddAssignees.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload`. @frozen public enum AssigneesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case1`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case1`. case case1(Swift.String) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case2`. public struct Case2Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2/login`. - public var login: Swift.String? + /// The login of the user to assign. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case2/login`. + public var login: Swift.String + /// Optional reasoning for adding this assignee. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case2/rationale`. + public var rationale: Swift.String? + /// If `true`, the assignee is stored as a pending suggestion for human review rather than applied directly. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case2/suggest`. + public var suggest: Swift.Bool? + /// The confidence level for this assignee choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case2/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// The confidence level for this assignee choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case2/confidence`. + public var confidence: Operations.IssuesAddAssignees.Input.Body.JsonPayload.AssigneesPayloadPayload.Case2Payload.ConfidencePayload? /// Creates a new `Case2Payload`. /// /// - Parameters: - /// - login: - public init(login: Swift.String? = nil) { + /// - login: The login of the user to assign. + /// - rationale: Optional reasoning for adding this assignee. + /// - suggest: If `true`, the assignee is stored as a pending suggestion for human review rather than applied directly. + /// - confidence: The confidence level for this assignee choice. + public init( + login: Swift.String, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesAddAssignees.Input.Body.JsonPayload.AssigneesPayloadPayload.Case2Payload.ConfidencePayload? = nil + ) { self.login = login + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence } public enum CodingKeys: String, CodingKey { case login + case rationale + case suggest + case confidence } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/AssigneesPayload/case2`. - case case2(Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayloadPayload.Case2Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/AssigneesPayload/case2`. + case case2(Operations.IssuesAddAssignees.Input.Body.JsonPayload.AssigneesPayloadPayload.Case2Payload) public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] do { @@ -15380,222 +17331,627 @@ public enum Operations { } } } - /// Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignees`. - public typealias AssigneesPayload = [Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayloadPayload] - /// Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/assignees`. + public typealias AssigneesPayload = [Operations.IssuesAddAssignees.Input.Body.JsonPayload.AssigneesPayloadPayload] + /// Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/assignees`. - public var assignees: Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload`. - public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the issue field to set - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/field_id`. - public var fieldId: Swift.Int - /// The value to set for the field. For multi-select fields, provide an array of option names. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case1`. - case case1(Swift.String) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case2`. - case case2(Swift.Double) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value/case3`. - case case3([Swift.String]) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/assignees`. + public var assignees: Operations.IssuesAddAssignees.Input.Body.JsonPayload.AssigneesPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - assignees: Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ + public init(assignees: Operations.IssuesAddAssignees.Input.Body.JsonPayload.AssigneesPayload? = nil) { + self.assignees = assignees + } + public enum CodingKeys: String, CodingKey { + case assignees + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddAssignees.Input.Body.JsonPayload) + } + public var body: Operations.IssuesAddAssignees.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesAddAssignees.Input.Path, + headers: Operations.IssuesAddAssignees.Input.Headers = .init(), + body: Operations.IssuesAddAssignees.Input.Body? = nil + ) { + 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}/assignees/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/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 } } - /// The value to set for the field. For multi-select fields, provide an array of option names. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/IssueFieldValuesPayload/value`. - public var value: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload - /// Creates a new `IssueFieldValuesPayloadPayload`. - /// - /// - Parameters: - /// - fieldId: The ID of the issue field to set - /// - value: The value to set for the field. For multi-select fields, provide an array of option names. - public init( - fieldId: Swift.Int, - value: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload - ) { - self.fieldId = fieldId - self.value = value - } - public enum CodingKeys: String, CodingKey { - case fieldId = "field_id" - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.fieldId = try container.decode( - Swift.Int.self, - forKey: .fieldId - ) - self.value = try container.decode( - Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "field_id", - "value" - ]) - } } - /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues + } + /// Received HTTP response body + public var body: Operations.IssuesAddAssignees.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesAddAssignees.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/post(issues/add-assignees)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.IssuesAddAssignees.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.IssuesAddAssignees.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove assignees from an issue + /// + /// Removes one or more assignees from an issue. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/delete(issues/remove-assignees)`. + public enum IssuesRemoveAssignees { + public static let id: Swift.String = "issues/remove-assignees" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/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}/assignees/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}/assignees/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}/assignees/DELETE/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesRemoveAssignees.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/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.IssuesRemoveAssignees.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/issue_field_values`. - public typealias IssueFieldValuesPayload = [Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] - /// An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody/json/assignees`. + public var assignees: [Swift.String]? + /// Creates a new `JsonPayload`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/issue_field_values`. - public var issueFieldValues: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayload? - /// The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. + /// - Parameters: + /// - assignees: Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ + public init(assignees: [Swift.String]? = nil) { + self.assignees = assignees + } + public enum CodingKeys: String, CodingKey { + case assignees + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody/content/application\/json`. + case json(Operations.IssuesRemoveAssignees.Input.Body.JsonPayload) + } + public var body: Operations.IssuesRemoveAssignees.Input.Body? + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesRemoveAssignees.Input.Path, + headers: Operations.IssuesRemoveAssignees.Input.Headers = .init(), + body: Operations.IssuesRemoveAssignees.Input.Body? = nil + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/json/type`. - public var _type: Swift.String? - /// Creates a new `JsonPayload`. + /// - 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.IssuesRemoveAssignees.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesRemoveAssignees.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/delete(issues/remove-assignees)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesRemoveAssignees.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.IssuesRemoveAssignees.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Check if a user can be assigned to a issue + /// + /// Checks if a user has permission to be assigned to a specific issue. + /// + /// If the `assignee` can be assigned to this issue, a `204` status code with no content is returned. + /// + /// Otherwise a `404` status code is returned. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)`. + public enum IssuesCheckUserCanBeAssignedToIssue { + public static let id: Swift.String = "issues/check-user-can-be-assigned-to-issue" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/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}/assignees/{assignee}/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}/assignees/{assignee}/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}/assignees/{assignee}/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/GET/path/assignee`. + public var assignee: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + /// - assignee: + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber, + assignee: Swift.String + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + self.assignee = assignee + } + } + public var path: Operations.IssuesCheckUserCanBeAssignedToIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/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.IssuesCheckUserCanBeAssignedToIssue.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.IssuesCheckUserCanBeAssignedToIssue.Input.Path, + headers: Operations.IssuesCheckUserCanBeAssignedToIssue.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response if `assignee` can be assigned to `issue_number` + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NoContent) + /// Response if `assignee` can be assigned to `issue_number` + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/GET/responses/404/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Parameters: - /// - title: The title of the issue. - /// - body: The contents of the issue. - /// - assignee: Username to assign to this issue. **This field is closing down.** - /// - state: The open or closed state of the issue. - /// - stateReason: The reason for the state change. Ignored unless `state` is changed. - /// - milestone: - /// - labels: Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. - /// - assignees: Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. - /// - issueFieldValues: An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues - /// - _type: The name of the issue type to associate with this issue or use `null` to remove the current issue type. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped. - public init( - title: Operations.IssuesUpdate.Input.Body.JsonPayload.TitlePayload? = nil, - body: Swift.String? = nil, - assignee: Swift.String? = nil, - state: Operations.IssuesUpdate.Input.Body.JsonPayload.StatePayload? = nil, - stateReason: Operations.IssuesUpdate.Input.Body.JsonPayload.StateReasonPayload? = nil, - milestone: Operations.IssuesUpdate.Input.Body.JsonPayload.MilestonePayload? = nil, - labels: Operations.IssuesUpdate.Input.Body.JsonPayload.LabelsPayload? = nil, - assignees: Operations.IssuesUpdate.Input.Body.JsonPayload.AssigneesPayload? = nil, - issueFieldValues: Operations.IssuesUpdate.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil, - _type: Swift.String? = nil - ) { - self.title = title - self.body = body - self.assignee = assignee - self.state = state - self.stateReason = stateReason - self.milestone = milestone - self.labels = labels - self.assignees = assignees - self.issueFieldValues = issueFieldValues - self._type = _type + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } } - public enum CodingKeys: String, CodingKey { - case title - case body - case assignee - case state - case stateReason = "state_reason" - case milestone - case labels - case assignees - case issueFieldValues = "issue_field_values" - case _type = "type" + } + /// Received HTTP response body + public var body: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound.Body) { + self.body = body + } + } + /// Response if `assignee` can not be assigned to `issue_number` + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.IssuesCheckUserCanBeAssignedToIssue.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.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/requestBody/content/application\/json`. - case json(Operations.IssuesUpdate.Input.Body.JsonPayload) } - public var body: Operations.IssuesUpdate.Input.Body? + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List issue comments + /// + /// You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. + /// + /// Issue comments are ordered by ascending ID. + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/comments`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)`. + public enum IssuesListComments { + public static let id: Swift.String = "issues/list-comments" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/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}/comments/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}/comments/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}/comments/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesListComments.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/query`. + public struct Query: Sendable, Hashable { + /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/query/since`. + public var since: Components.Parameters.Since? + /// 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}/comments/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + since: Components.Parameters.Since? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.since = since + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListComments.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesListComments.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesUpdate.Input.Path, - headers: Operations.IssuesUpdate.Input.Headers = .init(), - body: Operations.IssuesUpdate.Input.Body? = nil + path: Operations.IssuesListComments.Input.Path, + query: Operations.IssuesListComments.Input.Query = .init(), + headers: Operations.IssuesListComments.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value1`. - public var value1: Components.Schemas.Issue - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/json/value2`. - public var value2: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - value1: - /// - value2: - public init( - value1: Components.Schemas.Issue, - value2: OpenAPIRuntime.OpenAPIObjectContainer - ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Swift.Decoder) throws { - self.value1 = try .init(from: decoder) - self.value2 = try .init(from: decoder) - } - public func encode(to encoder: any Swift.Encoder) throws { - try self.value1.encode(to: encoder) - try self.value2.encode(to: encoder) - } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/PATCH/responses/200/content/application\/json`. - case json(Operations.IssuesUpdate.Output.Ok.Body.JsonPayload) + } + /// Received HTTP response headers + public var headers: Operations.IssuesListComments.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueComment]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.IssuesUpdate.Output.Ok.Body.JsonPayload { + public var json: [Components.Schemas.IssueComment] { get throws { switch self { case let .json(body): @@ -15605,26 +17961,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesUpdate.Output.Ok.Body + public var body: Operations.IssuesListComments.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.IssuesUpdate.Output.Ok.Body) { + public init( + headers: Operations.IssuesListComments.Output.Ok.Headers = .init(), + body: Operations.IssuesListComments.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesUpdate.Output.Ok) + case ok(Operations.IssuesListComments.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.IssuesUpdate.Output.Ok { + public var ok: Operations.IssuesListComments.Output.Ok { get throws { switch self { case let .ok(response): @@ -15637,47 +17998,252 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Service unavailable + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)/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 + ] + } + } + } + /// Create an issue comment + /// + /// You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). + /// Creating content too quickly using this endpoint may result in secondary rate limiting. + /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// + /// - **`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}/comments`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)`. + public enum IssuesCreateComment { + public static let id: Swift.String = "issues/create-comment" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/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}/comments/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}/comments/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}/comments/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesCreateComment.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesCreateComment.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The contents of the comment. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody/json/body`. + public var body: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - body: The contents of the comment. + public init(body: Swift.String) { + self.body = body + } + public enum CodingKeys: String, CodingKey { + case body + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody/content/application\/json`. + case json(Operations.IssuesCreateComment.Input.Body.JsonPayload) + } + public var body: Operations.IssuesCreateComment.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.IssuesCreateComment.Input.Path, + headers: Operations.IssuesCreateComment.Input.Headers = .init(), + body: Operations.IssuesCreateComment.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}/comments/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/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.IssuesCreateComment.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/responses/201/content/application\/json`. + case json(Components.Schemas.IssueComment) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.IssueComment { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesCreateComment.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesCreateComment.Output.Created.Headers = .init(), + body: Operations.IssuesCreateComment.Output.Created.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/201`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `201 created`. + case created(Operations.IssuesCreateComment.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.IssuesCreateComment.Output.Created { get throws { switch self { - case let .serviceUnavailable(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "created", response: self ) } @@ -15685,7 +18251,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -15706,70 +18272,70 @@ public enum Operations { } } } - /// Moved permanently + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/410`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .movedPermanently(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "gone", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Gone + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/patch(issues/update)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/404`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .gone(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "notFound", response: self ) } @@ -15806,28 +18372,35 @@ public enum Operations { } } } - /// Add assignees to an issue + /// List dependencies an issue is blocked by /// - /// Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. + /// You can use the REST API to list the dependencies an issue is blocked by. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/assignees`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/post(issues/add-assignees)`. - public enum IssuesAddAssignees { - public static let id: Swift.String = "issues/add-assignees" + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. + public enum IssuesListDependenciesBlockedBy { + public static let id: Swift.String = "issues/list-dependencies-blocked-by" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/assignees/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/assignees/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/assignees/POST/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -15845,69 +18418,84 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesAddAssignees.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/header`. + public var path: Operations.IssuesListDependenciesBlockedBy.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/dependencies/blocked_by/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListDependenciesBlockedBy.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesAddAssignees.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/json/assignees`. - public var assignees: [Swift.String]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - assignees: Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ - public init(assignees: [Swift.String]? = nil) { - self.assignees = assignees - } - public enum CodingKeys: String, CodingKey { - case assignees - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddAssignees.Input.Body.JsonPayload) - } - public var body: Operations.IssuesAddAssignees.Input.Body? + public var headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesAddAssignees.Input.Path, - headers: Operations.IssuesAddAssignees.Input.Headers = .init(), - body: Operations.IssuesAddAssignees.Input.Body? = nil + path: Operations.IssuesListDependenciesBlockedBy.Input.Path, + query: Operations.IssuesListDependenciesBlockedBy.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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.IssuesListDependenciesBlockedBy.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Issue) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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 { + public var json: [Components.Schemas.Issue] { get throws { switch self { case let .json(body): @@ -15916,34 +18504,108 @@ public enum Operations { } } } - /// Received HTTP response body - public var body: Operations.IssuesAddAssignees.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesAddAssignees.Output.Created.Body) { - self.body = body + /// Received HTTP response body + public var body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers = .init(), + body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListDependenciesBlockedBy.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.IssuesListDependenciesBlockedBy.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/post(issues/add-assignees)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/410`. /// - /// HTTP response code: `201 created`. - case created(Operations.IssuesAddAssignees.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// 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 `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.IssuesAddAssignees.Output.Created { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .created(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "gone", response: self ) } @@ -15980,28 +18642,39 @@ public enum Operations { } } } - /// Remove assignees from an issue + /// Add a dependency an issue is blocked by /// - /// Removes one or more assignees from an issue. + /// You can use the REST API to add a 'blocked by' relationship to an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/delete(issues/remove-assignees)`. - public enum IssuesRemoveAssignees { - public static let id: Swift.String = "issues/remove-assignees" + /// 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}/dependencies/blocked_by`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. + public enum IssuesAddBlockedByDependency { + public static let id: Swift.String = "issues/add-blocked-by-dependency" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/assignees/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/assignees/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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}/assignees/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -16019,42 +18692,42 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesRemoveAssignees.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/header`. + public var path: Operations.IssuesAddBlockedByDependency.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesRemoveAssignees.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody`. + public var headers: Operations.IssuesAddBlockedByDependency.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ + /// The id of the issue that blocks the current issue /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody/json/assignees`. - public var assignees: [Swift.String]? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json/issue_id`. + public var issueId: Swift.Int /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - assignees: Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ - public init(assignees: [Swift.String]? = nil) { - self.assignees = assignees + /// - issueId: The id of the issue that blocks the current issue + public init(issueId: Swift.Int) { + self.issueId = issueId } public enum CodingKeys: String, CodingKey { - case assignees + case issueId = "issue_id" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/requestBody/content/application\/json`. - case json(Operations.IssuesRemoveAssignees.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddBlockedByDependency.Input.Body.JsonPayload) } - public var body: Operations.IssuesRemoveAssignees.Input.Body? + public var body: Operations.IssuesAddBlockedByDependency.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -16062,9 +18735,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesRemoveAssignees.Input.Path, - headers: Operations.IssuesRemoveAssignees.Input.Headers = .init(), - body: Operations.IssuesRemoveAssignees.Input.Body? = nil + path: Operations.IssuesAddBlockedByDependency.Input.Path, + headers: Operations.IssuesAddBlockedByDependency.Input.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.Input.Body ) { self.path = path self.headers = headers @@ -16072,10 +18745,24 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/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.IssuesAddBlockedByDependency.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/DELETE/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content/application\/json`. case json(Components.Schemas.Issue) /// The associated value of the enum case if `self` is `.json`. /// @@ -16085,224 +18772,152 @@ public enum Operations { get throws { switch self { case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesRemoveAssignees.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesRemoveAssignees.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/delete(issues/remove-assignees)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesRemoveAssignees.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.IssuesRemoveAssignees.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Check if a user can be assigned to a issue - /// - /// Checks if a user has permission to be assigned to a specific issue. - /// - /// If the `assignee` can be assigned to this issue, a `204` status code with no content is returned. - /// - /// Otherwise a `404` status code is returned. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)`. - public enum IssuesCheckUserCanBeAssignedToIssue { - public static let id: Swift.String = "issues/check-user-can-be-assigned-to-issue" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/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}/assignees/{assignee}/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}/assignees/{assignee}/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}/assignees/{assignee}/GET/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/GET/path/assignee`. - public var assignee: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. - /// - assignee: - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber, - assignee: Swift.String - ) { - self.owner = owner - self.repo = repo - self.issueNumber = issueNumber - self.assignee = assignee + return body + } + } + } } - } - public var path: Operations.IssuesCheckUserCanBeAssignedToIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + /// Received HTTP response body + public var body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(), + body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + ) { + self.headers = headers + self.body = body } } - public var headers: Operations.IssuesCheckUserCanBeAssignedToIssue.Input.Headers - /// Creates a new `Input`. + /// Response /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.IssuesCheckUserCanBeAssignedToIssue.Input.Path, - headers: Operations.IssuesCheckUserCanBeAssignedToIssue.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response if `assignee` can be assigned to `issue_number` + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/201`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)/responses/204`. + /// HTTP response code: `201 created`. + case created(Operations.IssuesAddBlockedByDependency.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NoContent) - /// Response if `assignee` can be assigned to `issue_number` + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.IssuesAddBlockedByDependency.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/301`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } } - /// The associated value of the enum case if `self` is `.noContent`. + /// Forbidden /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NoContent { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/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 .noContent(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "forbidden", response: self ) } } } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/GET/responses/404/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/GET/responses/404/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/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 + ) } } - /// Received HTTP response body - public var body: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound.Body - /// Creates a new `NotFound`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound.Body) { - self.body = body + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } } } - /// Response if `assignee` can not be assigned to `issue_number` + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}/get(issues/check-user-can-be-assigned-to-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound) + case notFound(Components.Responses.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.IssuesCheckUserCanBeAssignedToIssue.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -16346,139 +18961,99 @@ public enum Operations { } } } - /// List issue comments - /// - /// You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. + /// Remove dependency an issue is blocked by /// - /// Issue comments are ordered by ascending ID. + /// You can use the REST API to remove a dependency that an issue is blocked by. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// 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). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass a specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/comments`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)`. - public enum IssuesListComments { - public static let id: Swift.String = "issues/list-comments" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. + public enum IssuesRemoveDependencyBlockedBy { + public static let id: Swift.String = "issues/remove-dependency-blocked-by" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber + /// The id of the blocking issue to remove as a dependency + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_id`. + public var issueId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. /// - issueNumber: The number that identifies the issue. + /// - issueId: The id of the blocking issue to remove as a dependency public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + issueNumber: Components.Parameters.IssueNumber, + issueId: Swift.Int ) { self.owner = owner self.repo = repo self.issueNumber = issueNumber + self.issueId = issueId } } - public var path: Operations.IssuesListComments.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/query`. - public struct Query: Sendable, Hashable { - /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/query/since`. - public var since: Components.Parameters.Since? - /// 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}/comments/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - since: Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - since: Components.Parameters.Since? = nil, - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.since = since - self.perPage = perPage - self.page = page - } - } - public var query: Operations.IssuesListComments.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/header`. + public var path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListComments.Input.Headers + public var headers: Operations.IssuesRemoveDependencyBlockedBy.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.IssuesListComments.Input.Path, - query: Operations.IssuesListComments.Input.Query = .init(), - headers: Operations.IssuesListComments.Input.Headers = .init() + path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path, + headers: Operations.IssuesRemoveDependencyBlockedBy.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}/comments/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.IssuesListComments.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/GET/responses/200/content/application\/json`. - case json([Components.Schemas.IssueComment]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/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.IssueComment] { + public var json: Components.Schemas.Issue { get throws { switch self { case let .json(body): @@ -16488,31 +19063,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListComments.Output.Ok.Body + public var body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListComments.Output.Ok.Headers = .init(), - body: Operations.IssuesListComments.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListComments.Output.Ok) + case ok(Operations.IssuesRemoveDependencyBlockedBy.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.IssuesListComments.Output.Ok { + public var ok: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok { get throws { switch self { case let .ok(response): @@ -16525,9 +19095,101 @@ public enum Operations { } } } + /// Moved permanently + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/301`. + /// + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. + /// + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { + get throws { + switch self { + case let .movedPermanently(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "movedPermanently", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/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}/comments/get(issues/list-comments)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -16550,7 +19212,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/get(issues/list-comments)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -16578,11 +19240,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -16593,49 +19258,47 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Create an issue comment - /// - /// You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. + /// List dependencies an issue is blocking /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). - /// Creating content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// You can use the REST API to list the dependencies an issue is blocking. /// - /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). /// - /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/comments`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)`. - public enum IssuesCreateComment { - public static let id: Swift.String = "issues/create-comment" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. + public enum IssuesListDependenciesBlocking { + public static let id: Swift.String = "issues/list-dependencies-blocking" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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}/comments/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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}/comments/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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}/comments/POST/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -16653,83 +19316,84 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesCreateComment.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/header`. + public var path: Operations.IssuesListDependenciesBlocking.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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}/dependencies/blocking/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListDependenciesBlocking.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesCreateComment.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The contents of the comment. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody/json/body`. - public var body: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - body: The contents of the comment. - public init(body: Swift.String) { - self.body = body - } - public enum CodingKeys: String, CodingKey { - case body - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/requestBody/content/application\/json`. - case json(Operations.IssuesCreateComment.Input.Body.JsonPayload) - } - public var body: Operations.IssuesCreateComment.Input.Body + public var headers: Operations.IssuesListDependenciesBlocking.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesCreateComment.Input.Path, - headers: Operations.IssuesCreateComment.Input.Headers = .init(), - body: Operations.IssuesCreateComment.Input.Body + path: Operations.IssuesListDependenciesBlocking.Input.Path, + query: Operations.IssuesListDependenciesBlocking.Input.Query = .init(), + headers: Operations.IssuesListDependenciesBlocking.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/responses/201/headers`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/responses/201/headers/Location`. - public var location: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? /// Creates a new `Headers`. /// /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } } /// Received HTTP response headers - public var headers: Operations.IssuesCreateComment.Output.Created.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/responses/201/content`. + public var headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/comments/POST/responses/201/content/application\/json`. - case json(Components.Schemas.IssueComment) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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.IssueComment { + public var json: [Components.Schemas.Issue] { get throws { switch self { case let .json(body): @@ -16739,15 +19403,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesCreateComment.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesCreateComment.Output.Created.Headers = .init(), - body: Operations.IssuesCreateComment.Output.Created.Body + headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers = .init(), + body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body ) { self.headers = headers self.body = body @@ -16755,114 +19419,91 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/201`. - /// - /// HTTP response code: `201 created`. - case created(Operations.IssuesCreateComment.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.IssuesCreateComment.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}/comments/post(issues/create-comment)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/200`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListDependenciesBlocking.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListDependenciesBlocking.Output.Ok { get throws { switch self { - case let .forbidden(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "ok", response: self ) } } } - /// Gone + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/301`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { get throws { switch self { - case let .gone(response): + case let .movedPermanently(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "movedPermanently", response: self ) } } } - /// Validation failed, or the endpoint has been spammed. + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/404`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .unprocessableContent(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/comments/post(issues/create-comment)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/410`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// 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 `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .notFound(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "gone", response: self ) } @@ -16899,35 +19540,28 @@ public enum Operations { } } } - /// List dependencies an issue is blocked by - /// - /// You can use the REST API to list the dependencies an issue is blocked by. - /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// List issue events /// - /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Lists all events for an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)`. - public enum IssuesListDependenciesBlockedBy { - public static let id: Swift.String = "issues/list-dependencies-blocked-by" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/events`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)`. + public enum IssuesListEvents { + public static let id: Swift.String = "issues/list-events" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -16945,16 +19579,16 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListDependenciesBlockedBy.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/query`. + public var path: Operations.IssuesListEvents.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query`. public struct Query: Sendable, Hashable { /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/query/per_page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// @@ -16969,19 +19603,19 @@ public enum Operations { self.page = page } } - public var query: Operations.IssuesListDependenciesBlockedBy.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/header`. + public var query: Operations.IssuesListEvents.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers + public var headers: Operations.IssuesListEvents.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -16989,9 +19623,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.IssuesListDependenciesBlockedBy.Input.Path, - query: Operations.IssuesListDependenciesBlockedBy.Input.Query = .init(), - headers: Operations.IssuesListDependenciesBlockedBy.Input.Headers = .init() + path: Operations.IssuesListEvents.Input.Path, + query: Operations.IssuesListEvents.Input.Query = .init(), + headers: Operations.IssuesListEvents.Input.Headers = .init() ) { self.path = path self.query = query @@ -17000,9 +19634,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/headers/Link`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -17013,16 +19647,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/content`. + public var headers: Operations.IssuesListEvents.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Issue]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueEventForIssue]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Issue] { + public var json: [Components.Schemas.IssueEventForIssue] { get throws { switch self { case let .json(body): @@ -17032,15 +19666,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + public var body: Operations.IssuesListEvents.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Headers = .init(), - body: Operations.IssuesListDependenciesBlockedBy.Output.Ok.Body + headers: Operations.IssuesListEvents.Output.Ok.Headers = .init(), + body: Operations.IssuesListEvents.Output.Ok.Body ) { self.headers = headers self.body = body @@ -17048,68 +19682,22 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListDependenciesBlockedBy.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.IssuesListDependenciesBlockedBy.Output.Ok { - get throws { - switch self { - case let .ok(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "ok", - response: self - ) - } - } - } - /// Moved permanently - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/301`. - /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. - /// - /// - Throws: An error if `self` is not `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { - get throws { - switch self { - case let .movedPermanently(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + case ok(Operations.IssuesListEvents.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListEvents.Output.Ok { get throws { switch self { - case let .notFound(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "ok", response: self ) } @@ -17117,7 +19705,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/get(issues/list-dependencies-blocked-by)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -17169,39 +19757,28 @@ public enum Operations { } } } - /// Add a dependency an issue is blocked by - /// - /// You can use the REST API to add a 'blocked by' relationship to an issue. - /// - /// Creating content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see [Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits) - /// and [Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api). - /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// List issue field values for an issue /// - /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. - /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. - /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// Lists all issue field values for an issue. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)`. - public enum IssuesAddBlockedByDependency { - public static let id: Swift.String = "issues/add-blocked-by-dependency" + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)`. + public enum IssuesListIssueFieldValuesForIssue { + public static let id: Swift.String = "issues/list-issue-field-values-for-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -17219,83 +19796,84 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesAddBlockedByDependency.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/header`. + public var path: Operations.IssuesListIssueFieldValuesForIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListIssueFieldValuesForIssue.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesAddBlockedByDependency.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The id of the issue that blocks the current issue - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/json/issue_id`. - public var issueId: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - issueId: The id of the issue that blocks the current issue - public init(issueId: Swift.Int) { - self.issueId = issueId - } - public enum CodingKeys: String, CodingKey { - case issueId = "issue_id" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddBlockedByDependency.Input.Body.JsonPayload) - } - public var body: Operations.IssuesAddBlockedByDependency.Input.Body + public var headers: Operations.IssuesListIssueFieldValuesForIssue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesAddBlockedByDependency.Input.Path, - headers: Operations.IssuesAddBlockedByDependency.Input.Headers = .init(), - body: Operations.IssuesAddBlockedByDependency.Input.Body + path: Operations.IssuesListIssueFieldValuesForIssue.Input.Path, + query: Operations.IssuesListIssueFieldValuesForIssue.Input.Query = .init(), + headers: Operations.IssuesListIssueFieldValuesForIssue.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/headers`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/headers`. public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/headers/Location`. - public var location: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? /// Creates a new `Headers`. /// /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link } } /// Received HTTP response headers - public var headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content`. + public var headers: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Issue) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueFieldValue]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { + public var json: [Components.Schemas.IssueFieldValue] { get throws { switch self { case let .json(body): @@ -17305,15 +19883,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesAddBlockedByDependency.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesAddBlockedByDependency.Output.Created.Headers = .init(), - body: Operations.IssuesAddBlockedByDependency.Output.Created.Body + headers: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Headers = .init(), + body: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Body ) { self.headers = headers self.body = body @@ -17321,22 +19899,22 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.IssuesAddBlockedByDependency.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListIssueFieldValuesForIssue.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.IssuesAddBlockedByDependency.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -17344,7 +19922,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -17365,24 +19943,24 @@ public enum Operations { } } } - /// Forbidden + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/404`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .forbidden(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "notFound", response: self ) } @@ -17390,7 +19968,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -17411,52 +19989,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Resource not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/post(issues/add-blocked-by-dependency)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -17488,99 +20020,229 @@ public enum Operations { } } } - /// Remove dependency an issue is blocked by + /// Add issue field values to an issue /// - /// You can use the REST API to remove a dependency that an issue is blocked by. + /// Add custom field values to an issue. You can set values for organization-level issue fields that have been defined for the repository's organization. + /// Adding an empty array will clear all existing field values for the issue. /// - /// 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 field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields /// - /// This 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`. + /// Only users with push access to the repository can add issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)`. - public enum IssuesRemoveDependencyBlockedBy { - public static let id: Swift.String = "issues/remove-dependency-blocked-by" + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)`. + public enum IssuesAddIssueFieldValues { + public static let id: Swift.String = "issues/add-issue-field-values" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber - /// The id of the blocking issue to remove as a dependency - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/path/issue_id`. - public var issueId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. /// - issueNumber: The number that identifies the issue. - /// - issueId: The id of the blocking issue to remove as a dependency public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber, - issueId: Swift.Int + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo self.issueNumber = issueNumber - self.issueId = issueId } } - public var path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/header`. + public var path: Operations.IssuesAddIssueFieldValues.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesRemoveDependencyBlockedBy.Input.Headers + public var headers: Operations.IssuesAddIssueFieldValues.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For multi_select fields: provide an array of option names (must match existing options) + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// The value to set for text, single_select, or date fields + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// The value to set for number fields + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + /// The value to set for multi_select fields (array of option names) + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case3`. + case case3([Swift.String]) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For multi_select fields: provide an array of option names (must match existing options) + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field. The type depends on the field's data type: + public init( + fieldId: Swift.Int, + value: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + ) { + self.fieldId = fieldId + self.value = value + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value" + ]) + } + } + /// An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - issueFieldValues: An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. + public init(issueFieldValues: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil) { + self.issueFieldValues = issueFieldValues + } + public enum CodingKeys: String, CodingKey { + case issueFieldValues = "issue_field_values" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload) + } + public var body: Operations.IssuesAddIssueFieldValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.IssuesRemoveDependencyBlockedBy.Input.Path, - headers: Operations.IssuesRemoveDependencyBlockedBy.Input.Headers = .init() + path: Operations.IssuesAddIssueFieldValues.Input.Path, + headers: Operations.IssuesAddIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesAddIssueFieldValues.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/DELETE/responses/200/content/application\/json`. - case json(Components.Schemas.Issue) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/responses/200/content/application\/json`. + case json([Components.Schemas.IssueFieldValue]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { + public var json: [Components.Schemas.IssueFieldValue] { get throws { switch self { case let .json(body): @@ -17590,26 +20252,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body + public var body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok.Body) { + public init(body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesRemoveDependencyBlockedBy.Output.Ok) + case ok(Operations.IssuesAddIssueFieldValues.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesRemoveDependencyBlockedBy.Output.Ok { + public var ok: Operations.IssuesAddIssueFieldValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -17622,32 +20284,9 @@ public enum Operations { } } } - /// Moved permanently - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/301`. - /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. - /// - /// - Throws: An error if `self` is not `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { - get throws { - switch self { - case let .movedPermanently(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", - response: self - ) - } - } - } /// Bad Request /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/400`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/400`. /// /// HTTP response code: `400 badRequest`. case badRequest(Components.Responses.BadRequest) @@ -17668,93 +20307,93 @@ public enum Operations { } } } - /// Requires authentication + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/401`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/403`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// 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 `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .unauthorized(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "forbidden", response: self ) } } } - /// Forbidden + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/404`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .forbidden(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/422`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Gone + /// Service unavailable /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}/delete(issues/remove-dependency-blocked-by)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/503`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { get throws { switch self { - case let .gone(response): + case let .serviceUnavailable(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "serviceUnavailable", response: self ) } @@ -17797,35 +20436,41 @@ public enum Operations { } } } - /// List dependencies an issue is blocking + /// Set issue field values for an issue /// - /// You can use the REST API to list the dependencies an issue is blocking. + /// Set custom field values for an issue, replacing any existing values. You can set values for organization-level issue fields that have been defined for the repository's organization. /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// This endpoint supports the following field data types: + /// - **`text`**: String values for text fields + /// - **`single_select`**: Option names for single-select fields (must match an existing option name) + /// - **`number`**: Numeric values for number fields + /// - **`date`**: ISO 8601 date strings for date fields /// - /// - **`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`. + /// This operation will replace all existing field values with the provided ones. If you want to add field values without replacing existing ones, use the `POST` endpoint instead. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)`. - public enum IssuesListDependenciesBlocking { - public static let id: Swift.String = "issues/list-dependencies-blocking" + /// Only users with push access to the repository can set issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)`. + public enum IssuesSetIssueFieldValues { + public static let id: Swift.String = "issues/set-issue-field-values" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -17843,84 +20488,164 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListDependenciesBlocking.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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}/dependencies/blocking/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.IssuesListDependenciesBlocking.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/header`. + public var path: Operations.IssuesSetIssueFieldValues.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListDependenciesBlocking.Input.Headers + public var headers: Operations.IssuesSetIssueFieldValues.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload`. + public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the issue field to set + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/field_id`. + public var fieldId: Swift.Int + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// The value to set for text, single_select, or date fields + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value/case1`. + case case1(Swift.String) + /// The value to set for number fields + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value/case2`. + case case2(Swift.Double) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// The value to set for the field. The type depends on the field's data type: + /// - For text fields: provide a string value + /// - For single_select fields: provide the option name as a string (must match an existing option) + /// - For number fields: provide a numeric value + /// - For date fields: provide an ISO 8601 date string + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value`. + public var value: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + /// Creates a new `IssueFieldValuesPayloadPayload`. + /// + /// - Parameters: + /// - fieldId: The ID of the issue field to set + /// - value: The value to set for the field. The type depends on the field's data type: + public init( + fieldId: Swift.Int, + value: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + ) { + self.fieldId = fieldId + self.value = value + } + public enum CodingKeys: String, CodingKey { + case fieldId = "field_id" + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.fieldId = try container.decode( + Swift.Int.self, + forKey: .fieldId + ) + self.value = try container.decode( + Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "field_id", + "value" + ]) + } + } + /// An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/issue_field_values`. + public typealias IssueFieldValuesPayload = [Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] + /// An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/issue_field_values`. + public var issueFieldValues: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - issueFieldValues: An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. + public init(issueFieldValues: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil) { + self.issueFieldValues = issueFieldValues + } + public enum CodingKeys: String, CodingKey { + case issueFieldValues = "issue_field_values" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/content/application\/json`. + case json(Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload) + } + public var body: Operations.IssuesSetIssueFieldValues.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: - public init( - path: Operations.IssuesListDependenciesBlocking.Input.Path, - query: Operations.IssuesListDependenciesBlocking.Input.Query = .init(), - headers: Operations.IssuesListDependenciesBlocking.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}/dependencies/blocking/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/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.IssuesListDependenciesBlocking.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/content`. + /// - body: + public init( + path: Operations.IssuesSetIssueFieldValues.Input.Path, + headers: Operations.IssuesSetIssueFieldValues.Input.Headers = .init(), + body: Operations.IssuesSetIssueFieldValues.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Issue]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/responses/200/content/application\/json`. + case json([Components.Schemas.IssueFieldValue]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Issue] { + public var json: [Components.Schemas.IssueFieldValue] { get throws { switch self { case let .json(body): @@ -17930,31 +20655,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body + public var body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListDependenciesBlocking.Output.Ok.Headers = .init(), - body: Operations.IssuesListDependenciesBlocking.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListDependenciesBlocking.Output.Ok) + case ok(Operations.IssuesSetIssueFieldValues.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesListDependenciesBlocking.Output.Ok { + public var ok: Operations.IssuesSetIssueFieldValues.Output.Ok { get throws { switch self { case let .ok(response): @@ -17967,287 +20687,116 @@ public enum Operations { } } } - /// Moved permanently - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/301`. - /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. - /// - /// - Throws: An error if `self` is not `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { - get throws { - switch self { - case let .movedPermanently(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", - response: self - ) - } - } - } - /// Resource not found + /// Bad Request /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/400`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .notFound(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "badRequest", response: self ) } } } - /// Gone + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking/get(issues/list-dependencies-blocking)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/403`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .gone(response): + case let .forbidden(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 - ] - } - } - } - /// List issue events - /// - /// Lists all events for an issue. - /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/events`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)`. - public enum IssuesListEvents { - public static let id: Swift.String = "issues/list-events" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// The number that identifies the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber - ) { - self.owner = owner - self.repo = repo - self.issueNumber = issueNumber - } - } - public var path: Operations.IssuesListEvents.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.IssuesListEvents.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/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.IssuesListEvents.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.IssuesListEvents.Input.Path, - query: Operations.IssuesListEvents.Input.Query = .init(), - headers: Operations.IssuesListEvents.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}/events/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.IssuesListEvents.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/events/GET/responses/200/content/application\/json`. - case json([Components.Schemas.IssueEventForIssue]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.IssueEventForIssue] { - get throws { - switch self { - case let .json(body): - return body - } - } + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.IssuesListEvents.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListEvents.Output.Ok.Headers = .init(), - body: Operations.IssuesListEvents.Output.Ok.Body - ) { - self.headers = headers - self.body = body + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } } } - /// Response + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/422`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListEvents.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesListEvents.Output.Ok { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .ok(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "unprocessableContent", response: self ) } } } - /// Gone + /// Service unavailable /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/events/get(issues/list-events)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/503`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { get throws { switch self { - case let .gone(response): + case let .serviceUnavailable(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "serviceUnavailable", response: self ) } @@ -18260,11 +20809,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -18275,196 +20827,151 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// List issue field values for an issue + /// Delete an issue field value from an issue /// - /// Lists all issue field values for an issue. + /// Remove a specific custom field value from an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)`. - public enum IssuesListIssueFieldValuesForIssue { - public static let id: Swift.String = "issues/list-issue-field-values-for-issue" + /// Only users with push access to the repository can delete issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + /// + /// If the specified field does not have a value set on the issue, this operation will return a `404` error. + /// + /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" + /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)`. + public enum IssuesDeleteIssueFieldValue { + public static let id: Swift.String = "issues/delete-issue-field-value" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber + /// The unique identifier of the issue field. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/issue_field_id`. + public var issueFieldId: Components.Parameters.IssueFieldId /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. /// - issueNumber: The number that identifies the issue. + /// - issueFieldId: The unique identifier of the issue field. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + issueNumber: Components.Parameters.IssueNumber, + issueFieldId: Components.Parameters.IssueFieldId ) { self.owner = owner self.repo = repo self.issueNumber = issueNumber + self.issueFieldId = issueFieldId } } - public var path: Operations.IssuesListIssueFieldValuesForIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.IssuesListIssueFieldValuesForIssue.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/header`. + public var path: Operations.IssuesDeleteIssueFieldValue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListIssueFieldValuesForIssue.Input.Headers + public var headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.IssuesListIssueFieldValuesForIssue.Input.Path, - query: Operations.IssuesListIssueFieldValuesForIssue.Input.Query = .init(), - headers: Operations.IssuesListIssueFieldValuesForIssue.Input.Headers = .init() + path: Operations.IssuesDeleteIssueFieldValue.Input.Path, + headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/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.IssuesListIssueFieldValuesForIssue.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/GET/responses/200/content/application\/json`. - case json([Components.Schemas.IssueFieldValue]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.IssueFieldValue] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Headers = .init(), - body: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response + /// Issue field value deleted successfully /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListIssueFieldValuesForIssue.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesDeleteIssueFieldValue.Output.NoContent) + /// Issue field value deleted successfully /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesListIssueFieldValuesForIssue.Output.Ok { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesDeleteIssueFieldValue.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } - /// Moved permanently + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/403`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .movedPermanently(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "forbidden", response: self ) } @@ -18472,7 +20979,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -18493,24 +21000,47 @@ public enum Operations { } } } - /// Gone + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/get(issues/list-issue-field-values-for-issue)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/422`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .gone(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", response: self ) } @@ -18532,244 +21062,138 @@ public enum Operations { self = .other(rawValue) } } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - } - } - public static var allCases: [Self] { - [ - .json - ] - } - } - } - /// Add issue field values to an issue - /// - /// Add custom field values to an issue. You can set values for organization-level issue fields that have been defined for the repository's organization. - /// Adding an empty array will clear all existing field values for the issue. - /// - /// This endpoint supports the following field data types: - /// - **`text`**: String values for text fields - /// - **`single_select`**: Option names for single-select fields (must match an existing option name) - /// - **`number`**: Numeric values for number fields - /// - **`date`**: ISO 8601 date strings for date fields - /// - /// Only users with push access to the repository can add issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)`. - public enum IssuesAddIssueFieldValues { - public static let id: Swift.String = "issues/add-issue-field-values" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// The number that identifies the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber - ) { - self.owner = owner - self.repo = repo - self.issueNumber = issueNumber - } - } - public var path: Operations.IssuesAddIssueFieldValues.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.IssuesAddIssueFieldValues.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload`. - public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the issue field to set - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/field_id`. - public var fieldId: Swift.Int - /// The value to set for the field. The type depends on the field's data type: - /// - For text fields: provide a string value - /// - For single_select fields: provide the option name as a string (must match an existing option) - /// - For number fields: provide a numeric value - /// - For multi_select fields: provide an array of option names (must match existing options) - /// - For date fields: provide an ISO 8601 date string - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// The value to set for text, single_select, or date fields - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case1`. - case case1(Swift.String) - /// The value to set for number fields - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case2`. - case case2(Swift.Double) - /// The value to set for multi_select fields (array of option names) - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value/case3`. - case case3([Swift.String]) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try encoder.encodeToSingleValueContainer(value) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } - } - /// The value to set for the field. The type depends on the field's data type: - /// - For text fields: provide a string value - /// - For single_select fields: provide the option name as a string (must match an existing option) - /// - For number fields: provide a numeric value - /// - For multi_select fields: provide an array of option names (must match existing options) - /// - For date fields: provide an ISO 8601 date string - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/IssueFieldValuesPayload/value`. - public var value: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload - /// Creates a new `IssueFieldValuesPayloadPayload`. - /// - /// - Parameters: - /// - fieldId: The ID of the issue field to set - /// - value: The value to set for the field. The type depends on the field's data type: - public init( - fieldId: Swift.Int, - value: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload - ) { - self.fieldId = fieldId - self.value = value - } - public enum CodingKeys: String, CodingKey { - case fieldId = "field_id" - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.fieldId = try container.decode( - Swift.Int.self, - forKey: .fieldId - ) - self.value = try container.decode( - Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "field_id", - "value" - ]) - } - } - /// An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/issue_field_values`. - public typealias IssueFieldValuesPayload = [Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] - /// An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/json/issue_field_values`. - public var issueFieldValues: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - issueFieldValues: An array of issue field values to add to this issue. Each field value must include the field ID and the value to set. - public init(issueFieldValues: Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil) { - self.issueFieldValues = issueFieldValues - } - public enum CodingKeys: String, CodingKey { - case issueFieldValues = "issue_field_values" - } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddIssueFieldValues.Input.Body.JsonPayload) } - public var body: Operations.IssuesAddIssueFieldValues.Input.Body + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List labels for an issue + /// + /// Lists all labels for an issue. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)`. + public enum IssuesListLabelsOnIssue { + public static let id: Swift.String = "issues/list-labels-on-issue" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesListLabelsOnIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListLabelsOnIssue.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesListLabelsOnIssue.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.IssuesAddIssueFieldValues.Input.Path, - headers: Operations.IssuesAddIssueFieldValues.Input.Headers = .init(), - body: Operations.IssuesAddIssueFieldValues.Input.Body + path: Operations.IssuesListLabelsOnIssue.Input.Path, + query: Operations.IssuesListLabelsOnIssue.Input.Query = .init(), + headers: Operations.IssuesListLabelsOnIssue.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesListLabelsOnIssue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/POST/responses/200/content/application\/json`. - case json([Components.Schemas.IssueFieldValue]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Label]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.IssueFieldValue] { + public var json: [Components.Schemas.Label] { get throws { switch self { case let .json(body): @@ -18779,26 +21203,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body + public var body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.IssuesAddIssueFieldValues.Output.Ok.Body) { + public init( + headers: Operations.IssuesListLabelsOnIssue.Output.Ok.Headers = .init(), + body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesAddIssueFieldValues.Output.Ok) + case ok(Operations.IssuesListLabelsOnIssue.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesAddIssueFieldValues.Output.Ok { + public var ok: Operations.IssuesListLabelsOnIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -18811,47 +21240,24 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Forbidden + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/301`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { get throws { switch self { - case let .forbidden(response): + case let .movedPermanently(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "movedPermanently", response: self ) } @@ -18859,7 +21265,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -18880,47 +21286,24 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Service unavailable + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/post(issues/add-issue-field-values)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/410`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// The associated value of the enum case if `self` is `.gone`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .serviceUnavailable(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "gone", response: self ) } @@ -18933,14 +21316,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -18950,54 +21330,38 @@ public enum Operations { case let .other(string): return string case .json: - return "application/json" - case .applicationScimJson: - return "application/scim+json" - } - } - public static var allCases: [Self] { - [ - .json, - .applicationScimJson - ] - } - } - } - /// Set issue field values for an issue - /// - /// Set custom field values for an issue, replacing any existing values. You can set values for organization-level issue fields that have been defined for the repository's organization. - /// - /// This endpoint supports the following field data types: - /// - **`text`**: String values for text fields - /// - **`single_select`**: Option names for single-select fields (must match an existing option name) - /// - **`number`**: Numeric values for number fields - /// - **`date`**: ISO 8601 date strings for date fields - /// - /// This operation will replace all existing field values with the provided ones. If you want to add field values without replacing existing ones, use the `POST` endpoint instead. - /// - /// Only users with push access to the repository can set issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add labels to an issue /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Adds labels to an issue. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)`. - public enum IssuesSetIssueFieldValues { - public static let id: Swift.String = "issues/set-issue-field-values" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. + public enum IssuesAddLabels { + public static let id: Swift.String = "issues/add-labels" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -19015,45 +21379,82 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesSetIssueFieldValues.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/header`. + public var path: Operations.IssuesAddLabels.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesSetIssueFieldValues.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody`. + public var headers: Operations.IssuesAddLabels.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload`. - public struct IssueFieldValuesPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the issue field to set - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/field_id`. - public var fieldId: Swift.Int - /// The value to set for the field. The type depends on the field's data type: - /// - For text fields: provide a string value - /// - For single_select fields: provide the option name as a string (must match an existing option) - /// - For number fields: provide a numeric value - /// - For date fields: provide an ISO 8601 date string - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value`. - @frozen public enum ValuePayload: Codable, Hashable, Sendable { - /// The value to set for text, single_select, or date fields - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value/case1`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload`. + @frozen public enum LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case1`. case case1(Swift.String) - /// The value to set for number fields - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value/case2`. - case case2(Swift.Double) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// The name of the label to add. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case2/name`. + public var name: Swift.String + /// Optional reasoning for adding this label. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case2/rationale`. + public var rationale: Swift.String? + /// If `true`, the label is stored as a pending suggestion for human review rather than applied directly. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case2/suggest`. + public var suggest: Swift.Bool? + /// The confidence level for this label choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case2/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// The confidence level for this label choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case2/confidence`. + public var confidence: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload.LabelsPayloadPayload.Case2Payload.ConfidencePayload? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - name: The name of the label to add. + /// - rationale: Optional reasoning for adding this label. + /// - suggest: If `true`, the label is stored as a pending suggestion for human review rather than applied directly. + /// - confidence: The confidence level for this label choice. + public init( + name: Swift.String, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload.LabelsPayloadPayload.Case2Payload.ConfidencePayload? = nil + ) { + self.name = name + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence + } + public enum CodingKeys: String, CodingKey { + case name + case rationale + case suggest + case confidence + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/LabelsPayload/case2`. + case case2(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload.LabelsPayloadPayload.Case2Payload) public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] do { @@ -19063,7 +21464,7 @@ public enum Operations { errors.append(error) } do { - self = .case2(try decoder.decodeFromSingleValueContainer()) + self = .case2(try .init(from: decoder)) return } catch { errors.append(error) @@ -19079,73 +21480,127 @@ public enum Operations { case let .case1(value): try encoder.encodeToSingleValueContainer(value) case let .case2(value): - try encoder.encodeToSingleValueContainer(value) + try value.encode(to: encoder) } } } - /// The value to set for the field. The type depends on the field's data type: - /// - For text fields: provide a string value - /// - For single_select fields: provide the option name as a string (must match an existing option) - /// - For number fields: provide a numeric value - /// - For date fields: provide an ISO 8601 date string + /// The labels to add to the issue's existing labels. You can also pass an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. To replace all of the labels for an issue, use "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/IssueFieldValuesPayload/value`. - public var value: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload - /// Creates a new `IssueFieldValuesPayloadPayload`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/labels`. + public typealias LabelsPayload = [Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload.LabelsPayloadPayload] + /// The labels to add to the issue's existing labels. You can also pass an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. To replace all of the labels for an issue, use "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/labels`. + public var labels: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload.LabelsPayload? + /// Creates a new `Case1Payload`. /// /// - Parameters: - /// - fieldId: The ID of the issue field to set - /// - value: The value to set for the field. The type depends on the field's data type: + /// - labels: The labels to add to the issue's existing labels. You can also pass an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. To replace all of the labels for an issue, use "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." + public init(labels: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload.LabelsPayload? = nil) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. + case case1(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case2`. + case case2([Swift.String]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload`. + public struct Case3PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload/name`. + public var name: Swift.String + /// Optional reasoning for adding this label. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload/rationale`. + public var rationale: Swift.String? + /// If `true`, the label is stored as a pending suggestion for human review rather than applied directly. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload/suggest`. + public var suggest: Swift.Bool? + /// The confidence level for this label choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload/confidence`. + @frozen public enum ConfidencePayload: String, Codable, Hashable, Sendable, CaseIterable { + case low = "low" + case medium = "medium" + case high = "high" + } + /// The confidence level for this label choice. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload/confidence`. + public var confidence: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3PayloadPayload.ConfidencePayload? + /// Creates a new `Case3PayloadPayload`. + /// + /// - Parameters: + /// - name: + /// - rationale: Optional reasoning for adding this label. + /// - suggest: If `true`, the label is stored as a pending suggestion for human review rather than applied directly. + /// - confidence: The confidence level for this label choice. public init( - fieldId: Swift.Int, - value: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload + name: Swift.String, + rationale: Swift.String? = nil, + suggest: Swift.Bool? = nil, + confidence: Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3PayloadPayload.ConfidencePayload? = nil ) { - self.fieldId = fieldId - self.value = value + self.name = name + self.rationale = rationale + self.suggest = suggest + self.confidence = confidence } public enum CodingKeys: String, CodingKey { - case fieldId = "field_id" - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.fieldId = try container.decode( - Swift.Int.self, - forKey: .fieldId - ) - self.value = try container.decode( - Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload.ValuePayload.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "field_id", - "value" - ]) + case name + case rationale + case suggest + case confidence } } - /// An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/issue_field_values`. - public typealias IssueFieldValuesPayload = [Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayloadPayload] - /// An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/json/issue_field_values`. - public var issueFieldValues: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - issueFieldValues: An array of issue field values to set for this issue. Each field value must include the field ID and the value to set. All existing field values will be replaced. - public init(issueFieldValues: Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload.IssueFieldValuesPayload? = nil) { - self.issueFieldValues = issueFieldValues + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. + public typealias Case3Payload = [Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3PayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. + case case3(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) } - public enum CodingKeys: String, CodingKey { - case issueFieldValues = "issue_field_values" + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/requestBody/content/application\/json`. - case json(Operations.IssuesSetIssueFieldValues.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddLabels.Input.Body.JsonPayload) } - public var body: Operations.IssuesSetIssueFieldValues.Input.Body + public var body: Operations.IssuesAddLabels.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -19153,9 +21608,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesSetIssueFieldValues.Input.Path, - headers: Operations.IssuesSetIssueFieldValues.Input.Headers = .init(), - body: Operations.IssuesSetIssueFieldValues.Input.Body + path: Operations.IssuesAddLabels.Input.Path, + headers: Operations.IssuesAddLabels.Input.Headers = .init(), + body: Operations.IssuesAddLabels.Input.Body? = nil ) { self.path = path self.headers = headers @@ -19164,15 +21619,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/PUT/responses/200/content/application\/json`. - case json([Components.Schemas.IssueFieldValue]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content/application\/json`. + case json([Components.Schemas.Label]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.IssueFieldValue] { + public var json: [Components.Schemas.Label] { get throws { switch self { case let .json(body): @@ -19182,26 +21637,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body + public var body: Operations.IssuesAddLabels.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesSetIssueFieldValues.Output.Ok.Body) { + public init(body: Operations.IssuesAddLabels.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesSetIssueFieldValues.Output.Ok) + case ok(Operations.IssuesAddLabels.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesSetIssueFieldValues.Output.Ok { + public var ok: Operations.IssuesAddLabels.Output.Ok { get throws { switch self { case let .ok(response): @@ -19214,47 +21669,24 @@ public enum Operations { } } } - /// Bad Request - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. - /// - /// - Throws: An error if `self` is not `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { - get throws { - switch self { - case let .badRequest(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", - response: self - ) - } - } - } - /// Forbidden + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/301`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { get throws { switch self { - case let .forbidden(response): + case let .movedPermanently(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "movedPermanently", response: self ) } @@ -19262,7 +21694,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -19283,9 +21715,32 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/410`. + /// + /// HTTP response code: `410 gone`. + case gone(Components.Responses.Gone) + /// 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}/issue-field-values/put(issues/set-issue-field-values)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -19306,199 +21761,312 @@ public enum Operations { } } } - /// Service unavailable - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/put(issues/set-issue-field-values)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// Undocumented response. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Set labels for an issue + /// + /// Removes any previous labels and sets the new labels for an issue. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)`. + public enum IssuesSetLabels { + public static let id: Swift.String = "issues/set-labels" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + } + } + public var path: Operations.IssuesSetLabels.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesSetLabels.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json`. + @frozen public enum JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1/labels`. + public var labels: [Swift.String]? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - labels: The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." + public init(labels: [Swift.String]? = nil) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. + case case1(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case1Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case2`. + case case2([Swift.String]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload`. + public struct LabelsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload/name`. + public var name: Swift.String + /// Creates a new `LabelsPayloadPayload`. + /// + /// - Parameters: + /// - name: + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. + public typealias LabelsPayload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. + public var labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - labels: + public init(labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? = nil) { + self.labels = labels + } + public enum CodingKeys: String, CodingKey { + case labels + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. + case case3(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload`. + public struct Case4PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload/name`. + public var name: Swift.String + /// Creates a new `Case4PayloadPayload`. + /// + /// - Parameters: + /// - name: + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. + public typealias Case4Payload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4PayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. + case case4(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4Payload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case5`. + case case5(Swift.String) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case4(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case5(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors ) } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try value.encode(to: encoder) + case let .case4(value): + try encoder.encodeToSingleValueContainer(value) + case let .case5(value): + try encoder.encodeToSingleValueContainer(value) + } + } } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/content/application\/json`. + case json(Operations.IssuesSetLabels.Input.Body.JsonPayload) } - /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case applicationScimJson - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "application/scim+json": - self = .applicationScimJson - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .applicationScimJson: - return "application/scim+json" - } - } - public static var allCases: [Self] { - [ - .json, - .applicationScimJson - ] - } - } - } - /// Delete an issue field value from an issue - /// - /// Remove a specific custom field value from an issue. - /// - /// Only users with push access to the repository can delete issue field values. If you don't have the proper permissions, you'll receive a `403 Forbidden` response. - /// - /// If the specified field does not have a value set on the issue, this operation will return a `404` error. - /// - /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." - /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)`. - public enum IssuesDeleteIssueFieldValue { - public static let id: Swift.String = "issues/delete-issue-field-value" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/repo`. - public var repo: Components.Parameters.Repo - /// The number that identifies the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber - /// The unique identifier of the issue field. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/path/issue_field_id`. - public var issueFieldId: Components.Parameters.IssueFieldId - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. - /// - issueFieldId: The unique identifier of the issue field. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber, - issueFieldId: Components.Parameters.IssueFieldId - ) { - self.owner = owner - self.repo = repo - self.issueNumber = issueNumber - self.issueFieldId = issueFieldId - } - } - public var path: Operations.IssuesDeleteIssueFieldValue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers + public var body: Operations.IssuesSetLabels.Input.Body? /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.IssuesDeleteIssueFieldValue.Input.Path, - headers: Operations.IssuesDeleteIssueFieldValue.Input.Headers = .init() + path: Operations.IssuesSetLabels.Input.Path, + headers: Operations.IssuesSetLabels.Input.Headers = .init(), + body: Operations.IssuesSetLabels.Input.Body? = nil ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content/application\/json`. + case json([Components.Schemas.Label]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Label] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesSetLabels.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.IssuesSetLabels.Output.Ok.Body) { + self.body = body + } } - /// Issue field value deleted successfully - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesDeleteIssueFieldValue.Output.NoContent) - /// Issue field value deleted successfully + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesSetLabels.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesDeleteIssueFieldValue.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesSetLabels.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } - /// Forbidden + /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/301`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `301 movedPermanently`. + case movedPermanently(Components.Responses.MovedPermanently) + /// The associated value of the enum case if `self` is `.movedPermanently`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.movedPermanently`. + /// - SeeAlso: `.movedPermanently`. + public var movedPermanently: Components.Responses.MovedPermanently { get throws { switch self { - case let .forbidden(response): + case let .movedPermanently(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "movedPermanently", response: self ) } @@ -19506,7 +22074,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -19527,47 +22095,47 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/410`. /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// 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 `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .unprocessableContent(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", + expectedStatus: "gone", response: self ) } } } - /// Service unavailable + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/issue-field-values/{issue_field_id}/delete(issues/delete-issue-field-value)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/422`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .serviceUnavailable(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "unprocessableContent", response: self ) } @@ -19604,28 +22172,28 @@ public enum Operations { } } } - /// List labels for an issue + /// Remove all labels from an issue /// - /// Lists all labels for an issue. + /// Removes all labels from an issue. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)`. - public enum IssuesListLabelsOnIssue { - public static let id: Swift.String = "issues/list-labels-on-issue" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)`. + public enum IssuesRemoveAllLabels { + public static let id: Swift.String = "issues/remove-all-labels" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -19643,125 +22211,63 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListLabelsOnIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/query/page`. - public var page: Components.Parameters.Page? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil - ) { - self.perPage = perPage - self.page = page - } - } - public var query: Operations.IssuesListLabelsOnIssue.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/header`. + public var path: Operations.IssuesRemoveAllLabels.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListLabelsOnIssue.Input.Headers + public var headers: Operations.IssuesRemoveAllLabels.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.IssuesListLabelsOnIssue.Input.Path, - query: Operations.IssuesListLabelsOnIssue.Input.Query = .init(), - headers: Operations.IssuesListLabelsOnIssue.Input.Headers = .init() + path: Operations.IssuesRemoveAllLabels.Input.Path, + headers: Operations.IssuesRemoveAllLabels.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}/labels/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/headers/Link`. - public var link: Components.Headers.Link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - link: - public init(link: Components.Headers.Link? = nil) { - self.link = link - } - } - /// Received HTTP response headers - public var headers: Operations.IssuesListLabelsOnIssue.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Label]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Label] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - headers: Received HTTP response headers - /// - body: Received HTTP response body - public init( - headers: Operations.IssuesListLabelsOnIssue.Output.Ok.Headers = .init(), - body: Operations.IssuesListLabelsOnIssue.Output.Ok.Body - ) { - self.headers = headers - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListLabelsOnIssue.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesRemoveAllLabels.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesListLabelsOnIssue.Output.Ok { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesRemoveAllLabels.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } @@ -19769,7 +22275,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -19792,7 +22298,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -19815,7 +22321,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/get(issues/list-labels-on-issue)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -19867,164 +22373,81 @@ public enum Operations { } } } - /// Add labels to an issue + /// Remove a label from an issue /// - /// Adds labels to an issue. + /// Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)`. - public enum IssuesAddLabels { - public static let id: Swift.String = "issues/add-labels" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)`. + public enum IssuesRemoveLabel { + public static let id: Swift.String = "issues/remove-label" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/repo`. - public var repo: Components.Parameters.Repo - /// The number that identifies the issue. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber - ) { - self.owner = owner - self.repo = repo - self.issueNumber = issueNumber - } - } - public var path: Operations.IssuesAddLabels.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.IssuesAddLabels.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The names of the labels to add to the issue's existing labels. You can also pass an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. To replace all of the labels for an issue, use "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1/labels`. - public var labels: [Swift.String]? - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - labels: The names of the labels to add to the issue's existing labels. You can also pass an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. To replace all of the labels for an issue, use "[Set labels for an issue](https://docs.github.com/rest/issues/labels#set-labels-for-an-issue)." - public init(labels: [Swift.String]? = nil) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case1`. - case case1(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case2`. - case case2([Swift.String]) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload`. - public struct Case3PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/Case3Payload/name`. - public var name: Swift.String - /// Creates a new `Case3PayloadPayload`. - /// - /// - Parameters: - /// - name: - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. - public typealias Case3Payload = [Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3PayloadPayload] - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/json/case3`. - case case3(Operations.IssuesAddLabels.Input.Body.JsonPayload.Case3Payload) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try encoder.encodeToSingleValueContainer(value) - } - } + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the issue. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/name`. + public var name: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + /// - name: + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber, + name: Swift.String + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + self.name = name } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddLabels.Input.Body.JsonPayload) } - public var body: Operations.IssuesAddLabels.Input.Body? + public var path: Operations.IssuesRemoveLabel.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.IssuesRemoveLabel.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.IssuesAddLabels.Input.Path, - headers: Operations.IssuesAddLabels.Input.Headers = .init(), - body: Operations.IssuesAddLabels.Input.Body? = nil + path: Operations.IssuesRemoveLabel.Input.Path, + headers: Operations.IssuesRemoveLabel.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/responses/200/content/application\/json`. case json([Components.Schemas.Label]) /// The associated value of the enum case if `self` is `.json`. /// @@ -20040,26 +22463,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesAddLabels.Output.Ok.Body + public var body: Operations.IssuesRemoveLabel.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesAddLabels.Output.Ok.Body) { + public init(body: Operations.IssuesRemoveLabel.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesAddLabels.Output.Ok) + case ok(Operations.IssuesRemoveLabel.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesAddLabels.Output.Ok { + public var ok: Operations.IssuesRemoveLabel.Output.Ok { get throws { switch self { case let .ok(response): @@ -20074,7 +22497,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -20097,7 +22520,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20120,7 +22543,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -20141,29 +22564,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/post(issues/add-labels)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -20195,28 +22595,30 @@ public enum Operations { } } } - /// Set labels for an issue + /// Lock an issue /// - /// Removes any previous labels and sets the new labels for an issue. + /// Users with push access can lock an issue or pull request's conversation. /// - /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)`. - public enum IssuesSetLabels { - public static let id: Swift.String = "issues/set-labels" + /// Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/issues/{issue_number}/lock`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)`. + public enum IssuesLock { + public static let id: Swift.String = "issues/lock" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -20234,156 +22636,59 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesSetLabels.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/header`. + public var path: Operations.IssuesLock.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesSetLabels.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody`. + public var headers: Operations.IssuesLock.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json`. - @frozen public enum JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. - public struct Case1Payload: Codable, Hashable, Sendable { - /// The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1/labels`. - public var labels: [Swift.String]? - /// Creates a new `Case1Payload`. - /// - /// - Parameters: - /// - labels: The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/rest/issues/labels#add-labels-to-an-issue)." - public init(labels: [Swift.String]? = nil) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case1`. - case case1(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case1Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case2`. - case case2([Swift.String]) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. - public struct Case3Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload`. - public struct LabelsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/LabelsPayload/name`. - public var name: Swift.String - /// Creates a new `LabelsPayloadPayload`. - /// - /// - Parameters: - /// - name: - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. - public typealias LabelsPayload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayloadPayload] - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3/labels`. - public var labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? - /// Creates a new `Case3Payload`. - /// - /// - Parameters: - /// - labels: - public init(labels: Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload.LabelsPayload? = nil) { - self.labels = labels - } - public enum CodingKeys: String, CodingKey { - case labels - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case3`. - case case3(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case3Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload`. - public struct Case4PayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/Case4Payload/name`. - public var name: Swift.String - /// Creates a new `Case4PayloadPayload`. - /// - /// - Parameters: - /// - name: - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + /// * `off-topic` + /// * `too heated` + /// * `resolved` + /// * `spam` + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. + @frozen public enum LockReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { + case offTopic = "off-topic" + case tooHeated = "too heated" + case resolved = "resolved" + case spam = "spam" } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. - public typealias Case4Payload = [Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4PayloadPayload] - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case4`. - case case4(Operations.IssuesSetLabels.Input.Body.JsonPayload.Case4Payload) - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/json/case5`. - case case5(Swift.String) - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self = .case1(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case2(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case3(try .init(from: decoder)) - return - } catch { - errors.append(error) - } - do { - self = .case4(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - do { - self = .case5(try decoder.decodeFromSingleValueContainer()) - return - } catch { - errors.append(error) - } - throw Swift.DecodingError.failedToDecodeOneOfSchema( - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + /// * `off-topic` + /// * `too heated` + /// * `resolved` + /// * `spam` + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. + public var lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - lockReason: The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + public init(lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? = nil) { + self.lockReason = lockReason } - public func encode(to encoder: any Swift.Encoder) throws { - switch self { - case let .case1(value): - try value.encode(to: encoder) - case let .case2(value): - try encoder.encodeToSingleValueContainer(value) - case let .case3(value): - try value.encode(to: encoder) - case let .case4(value): - try encoder.encodeToSingleValueContainer(value) - case let .case5(value): - try encoder.encodeToSingleValueContainer(value) - } + public enum CodingKeys: String, CodingKey { + case lockReason = "lock_reason" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/requestBody/content/application\/json`. - case json(Operations.IssuesSetLabels.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/content/application\/json`. + case json(Operations.IssuesLock.Input.Body.JsonPayload) } - public var body: Operations.IssuesSetLabels.Input.Body? + public var body: Operations.IssuesLock.Input.Body? /// Creates a new `Input`. /// /// - Parameters: @@ -20391,9 +22696,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesSetLabels.Input.Path, - headers: Operations.IssuesSetLabels.Input.Headers = .init(), - body: Operations.IssuesSetLabels.Input.Body? = nil + path: Operations.IssuesLock.Input.Path, + headers: Operations.IssuesLock.Input.Headers = .init(), + body: Operations.IssuesLock.Input.Body? = nil ) { self.path = path self.headers = headers @@ -20401,121 +22706,105 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/PUT/responses/200/content/application\/json`. - case json([Components.Schemas.Label]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Label] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.IssuesSetLabels.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.IssuesSetLabels.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesSetLabels.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.IssuesLock.Output.NoContent) + /// Response /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesSetLabels.Output.Ok { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.IssuesLock.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } - /// Moved permanently + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/403`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .movedPermanently(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "forbidden", response: self ) } } } - /// Resource not found + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/410`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// 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 `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .notFound(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "gone", response: self ) } } } - /// Gone + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/404`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .gone(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "notFound", response: self ) } @@ -20523,7 +22812,7 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/put(issues/set-labels)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -20575,28 +22864,28 @@ public enum Operations { } } } - /// Remove all labels from an issue + /// Unlock an issue /// - /// Removes all labels from an issue. + /// Users with push access can unlock an issue's conversation. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)`. - public enum IssuesRemoveAllLabels { - public static let id: Swift.String = "issues/remove-all-labels" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)`. + public enum IssuesUnlock { + public static let id: Swift.String = "issues/unlock" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -20614,27 +22903,27 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesRemoveAllLabels.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/DELETE/header`. + public var path: Operations.IssuesUnlock.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesRemoveAllLabels.Input.Headers + public var headers: Operations.IssuesUnlock.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.IssuesRemoveAllLabels.Input.Path, - headers: Operations.IssuesRemoveAllLabels.Input.Headers = .init() + path: Operations.IssuesUnlock.Input.Path, + headers: Operations.IssuesUnlock.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -20647,13 +22936,13 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesRemoveAllLabels.Output.NoContent) + case noContent(Operations.IssuesUnlock.Output.NoContent) /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -20663,7 +22952,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesRemoveAllLabels.Output.NoContent { + public var noContent: Operations.IssuesUnlock.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -20676,24 +22965,24 @@ public enum Operations { } } } - /// Moved permanently + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/403`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .movedPermanently(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "forbidden", response: self ) } @@ -20701,7 +22990,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20722,29 +23011,6 @@ public enum Operations { } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/delete(issues/remove-all-labels)/responses/410`. - /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. - /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { - get throws { - switch self { - case let .gone(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "gone", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -20776,71 +23042,73 @@ public enum Operations { } } } - /// Remove a label from an issue + /// Get parent issue /// - /// Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. + /// You can use the REST API to get the parent issue of a sub-issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)`. - public enum IssuesRemoveLabel { - public static let id: Swift.String = "issues/remove-label" + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. + public enum IssuesGetParent { + public static let id: Swift.String = "issues/get-parent" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/path/name`. - public var name: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. /// - issueNumber: The number that identifies the issue. - /// - name: public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber, - name: Swift.String + issueNumber: Components.Parameters.IssueNumber ) { self.owner = owner self.repo = repo self.issueNumber = issueNumber - self.name = name } } - public var path: Operations.IssuesRemoveLabel.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/header`. + public var path: Operations.IssuesGetParent.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesRemoveLabel.Input.Headers + public var headers: Operations.IssuesGetParent.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.IssuesRemoveLabel.Input.Path, - headers: Operations.IssuesRemoveLabel.Input.Headers = .init() + path: Operations.IssuesGetParent.Input.Path, + headers: Operations.IssuesGetParent.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -20848,15 +23116,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/DELETE/responses/200/content/application\/json`. - case json([Components.Schemas.Label]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Issue) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Label] { + public var json: Components.Schemas.Issue { get throws { switch self { case let .json(body): @@ -20866,26 +23134,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesRemoveLabel.Output.Ok.Body + public var body: Operations.IssuesGetParent.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesRemoveLabel.Output.Ok.Body) { + public init(body: Operations.IssuesGetParent.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesRemoveLabel.Output.Ok) + case ok(Operations.IssuesGetParent.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesRemoveLabel.Output.Ok { + public var ok: Operations.IssuesGetParent.Output.Ok { get throws { switch self { case let .ok(response): @@ -20900,7 +23168,7 @@ public enum Operations { } /// Moved permanently /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/301`. /// /// HTTP response code: `301 movedPermanently`. case movedPermanently(Components.Responses.MovedPermanently) @@ -20923,7 +23191,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -20946,7 +23214,7 @@ public enum Operations { } /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/labels/{name}/delete(issues/remove-label)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/410`. /// /// HTTP response code: `410 gone`. case gone(Components.Responses.Gone) @@ -20998,30 +23266,36 @@ public enum Operations { } } } - /// Lock an issue - /// - /// Users with push access can lock an issue or pull request's conversation. + /// Remove sub-issue /// - /// Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)." + /// 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 `PUT /repos/{owner}/{repo}/issues/{issue_number}/lock`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)`. - public enum IssuesLock { - public static let id: Swift.String = "issues/lock" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. + public enum IssuesRemoveSubIssue { + public static let id: Swift.String = "issues/remove-sub-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -21039,59 +23313,42 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesLock.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/header`. + public var path: Operations.IssuesRemoveSubIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesLock.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody`. + public var headers: Operations.IssuesRemoveSubIssue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - /// * `off-topic` - /// * `too heated` - /// * `resolved` - /// * `spam` - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. - @frozen public enum LockReasonPayload: String, Codable, Hashable, Sendable, CaseIterable { - case offTopic = "off-topic" - case tooHeated = "too heated" - case resolved = "resolved" - case spam = "spam" - } - /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - /// * `off-topic` - /// * `too heated` - /// * `resolved` - /// * `spam` + /// The id of the sub-issue to remove /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/json/lock_reason`. - public var lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json/sub_issue_id`. + public var subIssueId: Swift.Int /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - lockReason: The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - public init(lockReason: Operations.IssuesLock.Input.Body.JsonPayload.LockReasonPayload? = nil) { - self.lockReason = lockReason + /// - subIssueId: The id of the sub-issue to remove + public init(subIssueId: Swift.Int) { + self.subIssueId = subIssueId } public enum CodingKeys: String, CodingKey { - case lockReason = "lock_reason" + case subIssueId = "sub_issue_id" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/PUT/requestBody/content/application\/json`. - case json(Operations.IssuesLock.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/content/application\/json`. + case json(Operations.IssuesRemoveSubIssue.Input.Body.JsonPayload) } - public var body: Operations.IssuesLock.Input.Body? + public var body: Operations.IssuesRemoveSubIssue.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -21099,9 +23356,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesLock.Input.Path, - headers: Operations.IssuesLock.Input.Headers = .init(), - body: Operations.IssuesLock.Input.Body? = nil + path: Operations.IssuesRemoveSubIssue.Input.Path, + headers: Operations.IssuesRemoveSubIssue.Input.Headers = .init(), + body: Operations.IssuesRemoveSubIssue.Input.Body ) { self.path = path self.headers = headers @@ -21109,82 +23366,94 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesLock.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. - /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesLock.Output.NoContent { - get throws { - switch self { - case let .noContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "noContent", - response: self - ) + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content`. + @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.IssuesRemoveSubIssue.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers = .init(), + body: Operations.IssuesRemoveSubIssue.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } - /// Forbidden + /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/200`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesRemoveSubIssue.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesRemoveSubIssue.Output.Ok { get throws { switch self { - case let .forbidden(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "ok", response: self ) } } } - /// Gone - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/410`. + /// Bad Request /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/400`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .gone(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "badRequest", response: self ) } @@ -21192,7 +23461,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/404`. + /// - 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.NotFound) @@ -21213,29 +23482,6 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/put(issues/lock)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -21243,11 +23489,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -21258,37 +23507,47 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Unlock an issue + /// List sub-issues /// - /// Users with push access can unlock an issue's conversation. + /// You can use the REST API to list the sub-issues on an issue. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)`. - public enum IssuesUnlock { - public static let id: Swift.String = "issues/unlock" + /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// + /// - **`application/vnd.github.raw+json`**: Returns the raw Markdown body. Response will include `body`. This is the default if you do not pass any specific media type. + /// - **`application/vnd.github.text+json`**: Returns a text only representation of the Markdown body. Response will include `body_text`. + /// - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's Markdown. Response will include `body_html`. + /// - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. + public enum IssuesListSubIssues { + public static let id: Swift.String = "issues/list-sub-issues" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -21306,109 +23565,171 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesUnlock.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/lock/DELETE/header`. + public var path: Operations.IssuesListSubIssues.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.perPage = perPage + self.page = page + } + } + public var query: Operations.IssuesListSubIssues.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesUnlock.Input.Headers + public var headers: Operations.IssuesListSubIssues.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.IssuesUnlock.Input.Path, - headers: Operations.IssuesUnlock.Input.Headers = .init() + path: Operations.IssuesListSubIssues.Input.Path, + query: Operations.IssuesListSubIssues.Input.Query = .init(), + headers: Operations.IssuesListSubIssues.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/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.IssuesListSubIssues.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Issue]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Issue] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.IssuesListSubIssues.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.IssuesListSubIssues.Output.Ok.Headers = .init(), + body: Operations.IssuesListSubIssues.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.IssuesUnlock.Output.NoContent) - /// Response - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/204`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesListSubIssues.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.IssuesUnlock.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesListSubIssues.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } - /// Forbidden + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/404`. /// - /// HTTP response code: `403 forbidden`. - case forbidden(Components.Responses.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Components.Responses.Forbidden { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .forbidden(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", + expectedStatus: "notFound", response: self ) } } } - /// Resource not found + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/lock/delete(issues/unlock)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/410`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// 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 `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .notFound(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "gone", response: self ) } @@ -21445,35 +23766,39 @@ public enum Operations { } } } - /// Get parent issue + /// Add sub-issue /// - /// You can use the REST API to get the parent issue of a sub-issue. + /// You can use the REST API to add sub-issues to issues. /// - /// This endpoint supports the following custom media types. For more information, see [Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). + /// 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 `GET /repos/{owner}/{repo}/issues/{issue_number}/parent`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)`. - public enum IssuesGetParent { - public static let id: Swift.String = "issues/get-parent" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. + public enum IssuesAddSubIssue { + public static let id: Swift.String = "issues/add-sub-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -21491,37 +23816,87 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesGetParent.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/header`. + public var path: Operations.IssuesAddSubIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesGetParent.Input.Headers + public var headers: Operations.IssuesAddSubIssue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/sub_issue_id`. + public var subIssueId: Swift.Int + /// Option that, when true, instructs the operation to replace the sub-issues current parent issue + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/replace_parent`. + public var replaceParent: Swift.Bool? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - subIssueId: The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue + /// - replaceParent: Option that, when true, instructs the operation to replace the sub-issues current parent issue + public init( + subIssueId: Swift.Int, + replaceParent: Swift.Bool? = nil + ) { + self.subIssueId = subIssueId + self.replaceParent = replaceParent + } + public enum CodingKeys: String, CodingKey { + case subIssueId = "sub_issue_id" + case replaceParent = "replace_parent" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/content/application\/json`. + case json(Operations.IssuesAddSubIssue.Input.Body.JsonPayload) + } + public var body: Operations.IssuesAddSubIssue.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.IssuesGetParent.Input.Path, - headers: Operations.IssuesGetParent.Input.Headers = .init() + path: Operations.IssuesAddSubIssue.Input.Path, + headers: Operations.IssuesAddSubIssue.Input.Headers = .init(), + body: Operations.IssuesAddSubIssue.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers/Location`. + public var location: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - location: + public init(location: Swift.String? = nil) { + self.location = location + } + } + /// Received HTTP response headers + public var headers: Operations.IssuesAddSubIssue.Output.Created.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/parent/GET/responses/200/content/application\/json`. + /// - 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`. /// @@ -21537,102 +23912,130 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesGetParent.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.IssuesAddSubIssue.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.IssuesGetParent.Output.Ok.Body) { + public init( + headers: Operations.IssuesAddSubIssue.Output.Created.Headers = .init(), + body: Operations.IssuesAddSubIssue.Output.Created.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.IssuesGetParent.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.IssuesAddSubIssue.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesGetParent.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.IssuesAddSubIssue.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } - /// Moved permanently + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/301`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/403`. /// - /// HTTP response code: `301 movedPermanently`. - case movedPermanently(Components.Responses.MovedPermanently) - /// The associated value of the enum case if `self` is `.movedPermanently`. + /// 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 `.movedPermanently`. - /// - SeeAlso: `.movedPermanently`. - public var movedPermanently: Components.Responses.MovedPermanently { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .movedPermanently(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "movedPermanently", + expectedStatus: "forbidden", response: self ) } } } - /// Resource not found + /// Gone /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/410`. /// - /// HTTP response code: `404 notFound`. - case notFound(Components.Responses.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. + /// 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 `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { + /// - Throws: An error if `self` is not `.gone`. + /// - SeeAlso: `.gone`. + public var gone: Components.Responses.Gone { get throws { switch self { - case let .notFound(response): + case let .gone(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "gone", response: self ) } } } - /// Gone + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/parent/get(issues/get-parent)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/422`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .gone(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// 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.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", response: self ) } @@ -21669,36 +24072,28 @@ public enum Operations { } } } - /// Remove sub-issue + /// Reprioritize 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`. + /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. /// - /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)`. - public enum IssuesRemoveSubIssue { - public static let id: Swift.String = "issues/remove-sub-issue" + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. + public enum IssuesReprioritizeSubIssue { + public static let id: Swift.String = "issues/reprioritize-sub-issue" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path`. public struct Path: Sendable, Hashable { /// The account owner of the repository. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path/owner`. public var owner: Components.Parameters.Owner /// The name of the repository without the `.git` extension. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/path/repo`. + /// - 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_issue/DELETE/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -21716,42 +24111,60 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesRemoveSubIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/header`. + public var path: Operations.IssuesReprioritizeSubIssue.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesRemoveSubIssue.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody`. + public var headers: Operations.IssuesReprioritizeSubIssue.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json`. + /// - 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 remove + /// The id of the sub-issue to reprioritize /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/json/sub_issue_id`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/sub_issue_id`. public var subIssueId: Swift.Int + /// The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/after_id`. + public var afterId: Swift.Int? + /// The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/before_id`. + public var beforeId: Swift.Int? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - subIssueId: The id of the sub-issue to remove - public init(subIssueId: Swift.Int) { + /// - subIssueId: The id of the sub-issue to reprioritize + /// - afterId: The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). + /// - beforeId: The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). + public init( + subIssueId: Swift.Int, + afterId: Swift.Int? = nil, + beforeId: Swift.Int? = nil + ) { self.subIssueId = subIssueId + self.afterId = afterId + self.beforeId = beforeId } public enum CodingKeys: String, CodingKey { case subIssueId = "sub_issue_id" + case afterId = "after_id" + case beforeId = "before_id" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/requestBody/content/application\/json`. - case json(Operations.IssuesRemoveSubIssue.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/content/application\/json`. + case json(Operations.IssuesReprioritizeSubIssue.Input.Body.JsonPayload) } - public var body: Operations.IssuesRemoveSubIssue.Input.Body + public var body: Operations.IssuesReprioritizeSubIssue.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -21759,9 +24172,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.IssuesRemoveSubIssue.Input.Path, - headers: Operations.IssuesRemoveSubIssue.Input.Headers = .init(), - body: Operations.IssuesRemoveSubIssue.Input.Body + path: Operations.IssuesReprioritizeSubIssue.Input.Path, + headers: Operations.IssuesReprioritizeSubIssue.Input.Headers = .init(), + body: Operations.IssuesReprioritizeSubIssue.Input.Body ) { self.path = path self.headers = headers @@ -21770,23 +24183,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/headers/Location`. - public var location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issue/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/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`. + /// - 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`. /// @@ -21802,31 +24201,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesRemoveSubIssue.Output.Ok.Body + public var body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.IssuesRemoveSubIssue.Output.Ok.Headers = .init(), - body: Operations.IssuesRemoveSubIssue.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesRemoveSubIssue.Output.Ok) + case ok(Operations.IssuesReprioritizeSubIssue.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesRemoveSubIssue.Output.Ok { + public var ok: Operations.IssuesReprioritizeSubIssue.Output.Ok { get throws { switch self { case let .ok(response): @@ -21839,24 +24233,24 @@ public enum Operations { } } } - /// Bad Request + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/400`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/403`. /// - /// HTTP response code: `400 badRequest`. - case badRequest(Components.Responses.BadRequest) - /// The associated value of the enum case if `self` is `.badRequest`. + /// 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 `.badRequest`. - /// - SeeAlso: `.badRequest`. - public var badRequest: Components.Responses.BadRequest { + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { get throws { switch self { - case let .badRequest(response): + case let .forbidden(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "badRequest", + expectedStatus: "forbidden", response: self ) } @@ -21864,7 +24258,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issue/delete(issues/remove-sub-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -21885,6 +24279,52 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -21892,14 +24332,11 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json - case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json - case "application/scim+json": - self = .applicationScimJson default: self = .other(rawValue) } @@ -21910,47 +24347,43 @@ public enum Operations { return string case .json: return "application/json" - case .applicationScimJson: - return "application/scim+json" } } public static var allCases: [Self] { [ - .json, - .applicationScimJson + .json ] } } } - /// List sub-issues + /// List issue suggestions /// - /// You can use the REST API to list the sub-issues on an issue. + /// Lists the suggestions on an issue. A suggestion is an agent-proposed change to an issue's type, labels, fields, assignees, or closed state that a maintainer can approve or dismiss. /// - /// 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). + /// By default only pending suggestions are returned. Use `state=all` to return suggestions in every state, or `state=` to filter to a single state. Use `action=` to return only suggestions for a specific change. /// - /// - **`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`. + /// This endpoint is only available while the issue suggestions feature is enabled for the repository, and only supports issues, not pull requests. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)`. - public enum IssuesListSubIssues { - public static let id: Swift.String = "issues/list-sub-issues" + /// Requires triage access to the repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issues/{issue_number}/suggestions`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/get(issues/list-suggestions)`. + public enum IssuesListSuggestions { + public static let id: Swift.String = "issues/list-suggestions" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber /// Creates a new `Path`. /// @@ -21968,43 +24401,75 @@ public enum Operations { self.issueNumber = issueNumber } } - public var path: Operations.IssuesListSubIssues.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query`. + public var path: Operations.IssuesListSuggestions.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/query`. public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/query/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case pending = "pending" + case applied = "applied" + case approved = "approved" + case dismissed = "dismissed" + case replaced = "replaced" + case invalidated = "invalidated" + case all = "all" + } + /// Filter suggestions by their state. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/query/state`. + public var state: Operations.IssuesListSuggestions.Input.Query.StatePayload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/query/action`. + @frozen public enum ActionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case setType = "set_type" + case addLabel = "add_label" + case addField = "add_field" + case addAssignee = "add_assignee" + case closeIssue = "close_issue" + } + /// Filter suggestions by the change they propose. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/query/action`. + public var action: Operations.IssuesListSuggestions.Input.Query.ActionPayload? /// 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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/query/per_page`. public var perPage: Components.Parameters.PerPage? /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/query/page`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/query/page`. public var page: Components.Parameters.Page? /// Creates a new `Query`. /// /// - Parameters: + /// - state: Filter suggestions by their state. + /// - action: Filter suggestions by the change they propose. /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( + state: Operations.IssuesListSuggestions.Input.Query.StatePayload? = nil, + action: Operations.IssuesListSuggestions.Input.Query.ActionPayload? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil ) { + self.state = state + self.action = action self.perPage = perPage self.page = page } } - public var query: Operations.IssuesListSubIssues.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/header`. + public var query: Operations.IssuesListSuggestions.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesListSubIssues.Input.Headers + public var headers: Operations.IssuesListSuggestions.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -22012,9 +24477,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.IssuesListSubIssues.Input.Path, - query: Operations.IssuesListSubIssues.Input.Query = .init(), - headers: Operations.IssuesListSubIssues.Input.Headers = .init() + path: Operations.IssuesListSuggestions.Input.Path, + query: Operations.IssuesListSuggestions.Input.Query = .init(), + headers: Operations.IssuesListSuggestions.Input.Headers = .init() ) { self.path = path self.query = query @@ -22023,9 +24488,9 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/headers`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/responses/200/headers/Link`. public var link: Components.Headers.Link? /// Creates a new `Headers`. /// @@ -22036,16 +24501,16 @@ public enum Operations { } } /// Received HTTP response headers - public var headers: Operations.IssuesListSubIssues.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/GET/responses/200/content`. + public var headers: Operations.IssuesListSuggestions.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/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]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueSuggestion]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Issue] { + public var json: [Components.Schemas.IssueSuggestion] { get throws { switch self { case let .json(body): @@ -22055,15 +24520,15 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesListSubIssues.Output.Ok.Body + public var body: Operations.IssuesListSuggestions.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - headers: Received HTTP response headers /// - body: Received HTTP response body public init( - headers: Operations.IssuesListSubIssues.Output.Ok.Headers = .init(), - body: Operations.IssuesListSubIssues.Output.Ok.Body + headers: Operations.IssuesListSuggestions.Output.Ok.Headers = .init(), + body: Operations.IssuesListSuggestions.Output.Ok.Body ) { self.headers = headers self.body = body @@ -22071,15 +24536,15 @@ public enum Operations { } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/get(issues/list-suggestions)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesListSubIssues.Output.Ok) + case ok(Operations.IssuesListSuggestions.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.IssuesListSubIssues.Output.Ok { + public var ok: Operations.IssuesListSuggestions.Output.Ok { get throws { switch self { case let .ok(response): @@ -22094,7 +24559,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/get(issues/list-suggestions)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -22115,24 +24580,24 @@ public enum Operations { } } } - /// Gone + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/get(issues/list-sub-issues)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/get(issues/list-suggestions)/responses/422`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .gone(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "unprocessableContent", response: self ) } @@ -22169,143 +24634,91 @@ public enum Operations { } } } - /// Add sub-issue - /// - /// You can use the REST API to add sub-issues to issues. - /// - /// Creating content too quickly using this endpoint may result in secondary rate limiting. - /// For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" - /// and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." + /// Approve an issue suggestion /// - /// 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)." + /// Approves a pending suggestion on an issue. Applies the proposed change (creating the corresponding timeline event), transitions the suggestion to `approved`, and dismisses any competing pending suggestions for the same change. /// - /// - **`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`. + /// Requires triage access to the repository. Approving a suggestion also requires permission to perform the change it applies (for example, setting the issue type, adding a label or assignee, or closing the issue); this only affects fine-grained access tokens and GitHub Apps whose permissions are narrower than the triage role. This endpoint only supports issues, not pull requests. /// - /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)`. - public enum IssuesAddSubIssue { - public static let id: Swift.String = "issues/add-sub-issue" + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)`. + public enum IssuesApproveSuggestion { + public static let id: Swift.String = "issues/approve-suggestion" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/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`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/POST/path/repo`. public var repo: Components.Parameters.Repo /// The number that identifies the issue. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/path/issue_number`. - public var issueNumber: Components.Parameters.IssueNumber - /// Creates a new `Path`. - /// - /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - issueNumber: The number that identifies the issue. - public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber - ) { - self.owner = owner - self.repo = repo - self.issueNumber = issueNumber - } - } - public var path: Operations.IssuesAddSubIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/header`. - public 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.IssuesAddSubIssue.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/sub_issue_id`. - public var subIssueId: Swift.Int - /// Option that, when true, instructs the operation to replace the sub-issues current parent issue - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/json/replace_parent`. - public var replaceParent: Swift.Bool? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - subIssueId: The id of the sub-issue to add. The sub-issue must belong to the same repository owner as the parent issue - /// - replaceParent: Option that, when true, instructs the operation to replace the sub-issues current parent issue - public init( - subIssueId: Swift.Int, - replaceParent: Swift.Bool? = nil - ) { - self.subIssueId = subIssueId - self.replaceParent = replaceParent - } - public enum CodingKeys: String, CodingKey { - case subIssueId = "sub_issue_id" - case replaceParent = "replace_parent" - } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/POST/path/issue_number`. + public var issueNumber: Components.Parameters.IssueNumber + /// The unique identifier of the suggestion. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/POST/path/suggestion_id`. + public var suggestionId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - issueNumber: The number that identifies the issue. + /// - suggestionId: The unique identifier of the suggestion. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + issueNumber: Components.Parameters.IssueNumber, + suggestionId: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.issueNumber = issueNumber + self.suggestionId = suggestionId } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/requestBody/content/application\/json`. - case json(Operations.IssuesAddSubIssue.Input.Body.JsonPayload) } - public var body: Operations.IssuesAddSubIssue.Input.Body + public var path: Operations.IssuesApproveSuggestion.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/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.IssuesApproveSuggestion.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.IssuesAddSubIssue.Input.Path, - headers: Operations.IssuesAddSubIssue.Input.Headers = .init(), - body: Operations.IssuesAddSubIssue.Input.Body + path: Operations.IssuesApproveSuggestion.Input.Path, + headers: Operations.IssuesApproveSuggestion.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/headers/Location`. - public var location: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - location: - public init(location: Swift.String? = nil) { - self.location = location - } - } - /// Received HTTP response headers - public var headers: Operations.IssuesAddSubIssue.Output.Created.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/POST/responses/200/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) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/POST/responses/200/content/application\/json`. + case json(Components.Schemas.IssueSuggestion) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { + public var json: Components.Schemas.IssueSuggestion { get throws { switch self { case let .json(body): @@ -22315,38 +24728,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesAddSubIssue.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.IssuesApproveSuggestion.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.IssuesAddSubIssue.Output.Created.Headers = .init(), - body: Operations.IssuesAddSubIssue.Output.Created.Body - ) { - self.headers = headers + public init(body: Operations.IssuesApproveSuggestion.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/201`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.IssuesAddSubIssue.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.IssuesApproveSuggestion.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.IssuesAddSubIssue.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.IssuesApproveSuggestion.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } @@ -22354,7 +24762,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -22375,24 +24783,24 @@ public enum Operations { } } } - /// Gone + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/post(issues/add-sub-issue)/responses/410`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)/responses/404`. /// - /// HTTP response code: `410 gone`. - case gone(Components.Responses.Gone) - /// The associated value of the enum case if `self` is `.gone`. + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.gone`. - /// - SeeAlso: `.gone`. - public var gone: Components.Responses.Gone { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { get throws { switch self { - case let .gone(response): + case let .notFound(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "gone", + expectedStatus: "notFound", response: self ) } @@ -22400,7 +24808,7 @@ public enum Operations { } /// 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`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve/post(issues/approve-suggestion)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. case unprocessableContent(Components.Responses.ValidationFailed) @@ -22421,29 +24829,6 @@ public enum Operations { } } } - /// 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.NotFound) - /// The associated value of the enum case if `self` is `.notFound`. - /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.NotFound { - get throws { - switch self { - case let .notFound(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "notFound", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -22475,126 +24860,91 @@ public enum Operations { } } } - /// Reprioritize sub-issue + /// Dismiss an issue suggestion /// - /// You can use the REST API to reprioritize a sub-issue to a different position in the parent list. + /// Dismisses a pending suggestion on an issue. Transitions the suggestion to `dismissed` without applying any change or creating a timeline event. /// - /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)`. - public enum IssuesReprioritizeSubIssue { - public static let id: Swift.String = "issues/reprioritize-sub-issue" + /// Requires triage access to the repository. This endpoint only supports issues, not pull requests. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)`. + public enum IssuesDismissSuggestion { + public static let id: Swift.String = "issues/dismiss-suggestion" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/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/priority/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/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/priority/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/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/priority/PATCH/path/issue_number`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/POST/path/issue_number`. public var issueNumber: Components.Parameters.IssueNumber + /// The unique identifier of the suggestion. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/POST/path/suggestion_id`. + public var suggestionId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. /// - issueNumber: The number that identifies the issue. + /// - suggestionId: The unique identifier of the suggestion. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - issueNumber: Components.Parameters.IssueNumber + issueNumber: Components.Parameters.IssueNumber, + suggestionId: Swift.Int ) { self.owner = owner self.repo = repo self.issueNumber = issueNumber + self.suggestionId = suggestionId } } - public var path: Operations.IssuesReprioritizeSubIssue.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/header`. + public var path: Operations.IssuesDismissSuggestion.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.IssuesReprioritizeSubIssue.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The id of the sub-issue to reprioritize - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/sub_issue_id`. - public var subIssueId: Swift.Int - /// The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/after_id`. - public var afterId: Swift.Int? - /// The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/json/before_id`. - public var beforeId: Swift.Int? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - subIssueId: The id of the sub-issue to reprioritize - /// - afterId: The id of the sub-issue to be prioritized after (either positional argument after OR before should be specified). - /// - beforeId: The id of the sub-issue to be prioritized before (either positional argument after OR before should be specified). - public init( - subIssueId: Swift.Int, - afterId: Swift.Int? = nil, - beforeId: Swift.Int? = nil - ) { - self.subIssueId = subIssueId - self.afterId = afterId - self.beforeId = beforeId - } - public enum CodingKeys: String, CodingKey { - case subIssueId = "sub_issue_id" - case afterId = "after_id" - case beforeId = "before_id" - } - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/requestBody/content/application\/json`. - case json(Operations.IssuesReprioritizeSubIssue.Input.Body.JsonPayload) - } - public var body: Operations.IssuesReprioritizeSubIssue.Input.Body + public var headers: Operations.IssuesDismissSuggestion.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.IssuesReprioritizeSubIssue.Input.Path, - headers: Operations.IssuesReprioritizeSubIssue.Input.Headers = .init(), - body: Operations.IssuesReprioritizeSubIssue.Input.Body + path: Operations.IssuesDismissSuggestion.Input.Path, + headers: Operations.IssuesDismissSuggestion.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/POST/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) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/POST/responses/200/content/application\/json`. + case json(Components.Schemas.IssueSuggestion) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Issue { + public var json: Components.Schemas.IssueSuggestion { get throws { switch self { case let .json(body): @@ -22604,26 +24954,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body + public var body: Operations.IssuesDismissSuggestion.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.IssuesReprioritizeSubIssue.Output.Ok.Body) { + public init(body: Operations.IssuesDismissSuggestion.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.IssuesReprioritizeSubIssue.Output.Ok) + case ok(Operations.IssuesDismissSuggestion.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.IssuesReprioritizeSubIssue.Output.Ok { + public var ok: Operations.IssuesDismissSuggestion.Output.Ok { get throws { switch self { case let .ok(response): @@ -22638,7 +24988,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -22661,7 +25011,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -22684,15 +25034,15 @@ public enum Operations { } /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/422`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss/post(issues/dismiss-suggestion)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) + case unprocessableContent(Components.Responses.ValidationFailed) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { case let .unprocessableContent(response): @@ -22705,29 +25055,6 @@ public enum Operations { } } } - /// Service unavailable - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority/patch(issues/reprioritize-sub-issue)/responses/503`. - /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. - /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { - get throws { - switch self { - case let .serviceUnavailable(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -22809,17 +25136,24 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/query/page`. public var page: Components.Parameters.Page? + /// A comma-separated list of timeline event names to exclude from the response. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issues/{issue_number}/timeline/GET/query/exclude`. + public var exclude: Components.Parameters.IssueTimelineExclude? /// Creates a new `Query`. /// /// - Parameters: /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - exclude: A comma-separated list of timeline event names to exclude from the response. public init( perPage: Components.Parameters.PerPage? = nil, - page: Components.Parameters.Page? = nil + page: Components.Parameters.Page? = nil, + exclude: Components.Parameters.IssueTimelineExclude? = nil ) { self.perPage = perPage self.page = page + self.exclude = exclude } } public var query: Operations.IssuesListEventsForTimeline.Input.Query @@ -22945,6 +25279,29 @@ public enum Operations { } } } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } /// Gone /// /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issues/{issue_number}/timeline/get(issues/list-events-for-timeline)/responses/410`. @@ -22975,11 +25332,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -22990,11 +25350,14 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } From 9856b100f2871a6299200d9d5193b6b44c32baef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:40:06 +0000 Subject: [PATCH 07/18] Commit via running: make Sources/meta --- Sources/meta/Types.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/meta/Types.swift b/Sources/meta/Types.swift index f5f5814481..283ea5537f 100644 --- a/Sources/meta/Types.swift +++ b/Sources/meta/Types.swift @@ -458,6 +458,8 @@ public enum Components { public var dependabot: [Swift.String]? /// - Remark: Generated from `#/components/schemas/api-overview/copilot`. public var copilot: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/api-overview/commit_signing_keys`. + public var commitSigningKeys: [Swift.String]? /// - Remark: Generated from `#/components/schemas/api-overview/domains`. public struct DomainsPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/api-overview/domains/website`. @@ -578,6 +580,7 @@ public enum Components { /// - codespaces: /// - dependabot: /// - copilot: + /// - commitSigningKeys: /// - domains: public init( verifiablePasswordAuthentication: Swift.Bool, @@ -596,6 +599,7 @@ public enum Components { codespaces: [Swift.String]? = nil, dependabot: [Swift.String]? = nil, copilot: [Swift.String]? = nil, + commitSigningKeys: [Swift.String]? = nil, domains: Components.Schemas.ApiOverview.DomainsPayload? = nil ) { self.verifiablePasswordAuthentication = verifiablePasswordAuthentication @@ -614,6 +618,7 @@ public enum Components { self.codespaces = codespaces self.dependabot = dependabot self.copilot = copilot + self.commitSigningKeys = commitSigningKeys self.domains = domains } public enum CodingKeys: String, CodingKey { @@ -633,6 +638,7 @@ public enum Components { case codespaces case dependabot case copilot + case commitSigningKeys = "commit_signing_keys" case domains } } From 6253664cde4448d174e494bae179a4db4e0777f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:41:15 +0000 Subject: [PATCH 08/18] Commit via running: make Sources/orgs --- Sources/orgs/Client.swift | 315 +++++++++ Sources/orgs/Types.swift | 1380 ++++++++++++++++++++++++++++++++++--- 2 files changed, 1600 insertions(+), 95 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 59110c5275..379a099d5a 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -662,6 +662,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 207: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .code207(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden.Body @@ -718,6 +740,259 @@ public struct Client: APIProtocol { } ) } + /// Create a cluster deployment records job + /// + /// Create a background job to set deployment records for a given cluster. + /// Performs validation and permission checks synchronously, returning rejected + /// deployments immediately, then enqueues a background job for the actual + /// deployment updates. Use the companion GET endpoint to poll for job status. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)`. + public func orgsCreateClusterDeploymentRecordsJob(_ input: Operations.OrgsCreateClusterDeploymentRecordsJob.Input) async throws -> Operations.OrgsCreateClusterDeploymentRecordsJob.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsCreateClusterDeploymentRecordsJob.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/artifacts/metadata/deployment-record/cluster/{}/jobs", + parameters: [ + input.path.org, + input.path.cluster + ] + ) + 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 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get cluster deployment records job status + /// + /// Get the status and results of a previously created cluster deployment records job. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/get(orgs/get-cluster-deployment-records-job)`. + public func orgsGetClusterDeploymentRecordsJob(_ input: Operations.OrgsGetClusterDeploymentRecordsJob.Input) async throws -> Operations.OrgsGetClusterDeploymentRecordsJob.Output { + try await client.send( + input: input, + forOperation: Operations.OrgsGetClusterDeploymentRecordsJob.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/artifacts/metadata/deployment-record/cluster/{}/jobs/{}", + parameters: [ + input.path.org, + input.path.cluster, + input.path.jobId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsGetClusterDeploymentRecordsJob.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Create artifact metadata storage record /// /// Create metadata storage records for artifacts associated with an organization. @@ -3010,6 +3285,8 @@ public struct Client: APIProtocol { /// /// Get API request count statistics for an actor broken down by route within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. public func apiInsightsGetRouteStatsByActor(_ input: Operations.ApiInsightsGetRouteStatsByActor.Input) async throws -> Operations.ApiInsightsGetRouteStatsByActor.Output { @@ -3125,6 +3402,8 @@ public struct Client: APIProtocol { /// /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. public func apiInsightsGetSubjectStats(_ input: Operations.ApiInsightsGetSubjectStats.Input) async throws -> Operations.ApiInsightsGetSubjectStats.Output { @@ -3238,6 +3517,8 @@ public struct Client: APIProtocol { /// /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. public func apiInsightsGetSummaryStats(_ input: Operations.ApiInsightsGetSummaryStats.Input) async throws -> Operations.ApiInsightsGetSummaryStats.Output { @@ -3316,6 +3597,8 @@ public struct Client: APIProtocol { /// /// Get overall statistics of API requests within the organization for a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. public func apiInsightsGetSummaryStatsByUser(_ input: Operations.ApiInsightsGetSummaryStatsByUser.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByUser.Output { @@ -3395,6 +3678,8 @@ public struct Client: APIProtocol { /// /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. public func apiInsightsGetSummaryStatsByActor(_ input: Operations.ApiInsightsGetSummaryStatsByActor.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByActor.Output { @@ -3475,6 +3760,8 @@ public struct Client: APIProtocol { /// /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. public func apiInsightsGetTimeStats(_ input: Operations.ApiInsightsGetTimeStats.Input) async throws -> Operations.ApiInsightsGetTimeStats.Output { @@ -3560,6 +3847,8 @@ public struct Client: APIProtocol { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. public func apiInsightsGetTimeStatsByUser(_ input: Operations.ApiInsightsGetTimeStatsByUser.Input) async throws -> Operations.ApiInsightsGetTimeStatsByUser.Output { @@ -3646,6 +3935,8 @@ public struct Client: APIProtocol { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. public func apiInsightsGetTimeStatsByActor(_ input: Operations.ApiInsightsGetTimeStatsByActor.Input) async throws -> Operations.ApiInsightsGetTimeStatsByActor.Output { @@ -3733,6 +4024,8 @@ public struct Client: APIProtocol { /// /// Get API usage statistics within an organization for a user broken down by the type of access. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. public func apiInsightsGetUserStats(_ input: Operations.ApiInsightsGetUserStats.Input) async throws -> Operations.ApiInsightsGetUserStats.Output { @@ -10331,6 +10624,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsUpdateMembershipForAuthenticatedUser.Output.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.OrgMembership.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 9a4a4b3720..5680a179db 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -99,6 +99,23 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)`. func orgsSetClusterDeploymentRecords(_ input: Operations.OrgsSetClusterDeploymentRecords.Input) async throws -> Operations.OrgsSetClusterDeploymentRecords.Output + /// Create a cluster deployment records job + /// + /// Create a background job to set deployment records for a given cluster. + /// Performs validation and permission checks synchronously, returning rejected + /// deployments immediately, then enqueues a background job for the actual + /// deployment updates. Use the companion GET endpoint to poll for job status. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)`. + func orgsCreateClusterDeploymentRecordsJob(_ input: Operations.OrgsCreateClusterDeploymentRecordsJob.Input) async throws -> Operations.OrgsCreateClusterDeploymentRecordsJob.Output + /// Get cluster deployment records job status + /// + /// Get the status and results of a previously created cluster deployment records job. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/get(orgs/get-cluster-deployment-records-job)`. + func orgsGetClusterDeploymentRecordsJob(_ input: Operations.OrgsGetClusterDeploymentRecordsJob.Input) async throws -> Operations.OrgsGetClusterDeploymentRecordsJob.Output /// Create artifact metadata storage record /// /// Create metadata storage records for artifacts associated with an organization. @@ -352,6 +369,8 @@ public protocol APIProtocol: Sendable { /// /// Get API request count statistics for an actor broken down by route within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. func apiInsightsGetRouteStatsByActor(_ input: Operations.ApiInsightsGetRouteStatsByActor.Input) async throws -> Operations.ApiInsightsGetRouteStatsByActor.Output @@ -359,6 +378,8 @@ public protocol APIProtocol: Sendable { /// /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. func apiInsightsGetSubjectStats(_ input: Operations.ApiInsightsGetSubjectStats.Input) async throws -> Operations.ApiInsightsGetSubjectStats.Output @@ -366,6 +387,8 @@ public protocol APIProtocol: Sendable { /// /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. func apiInsightsGetSummaryStats(_ input: Operations.ApiInsightsGetSummaryStats.Input) async throws -> Operations.ApiInsightsGetSummaryStats.Output @@ -373,6 +396,8 @@ public protocol APIProtocol: Sendable { /// /// Get overall statistics of API requests within the organization for a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. func apiInsightsGetSummaryStatsByUser(_ input: Operations.ApiInsightsGetSummaryStatsByUser.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByUser.Output @@ -380,6 +405,8 @@ public protocol APIProtocol: Sendable { /// /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. func apiInsightsGetSummaryStatsByActor(_ input: Operations.ApiInsightsGetSummaryStatsByActor.Input) async throws -> Operations.ApiInsightsGetSummaryStatsByActor.Output @@ -387,6 +414,8 @@ public protocol APIProtocol: Sendable { /// /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. func apiInsightsGetTimeStats(_ input: Operations.ApiInsightsGetTimeStats.Input) async throws -> Operations.ApiInsightsGetTimeStats.Output @@ -394,6 +423,8 @@ public protocol APIProtocol: Sendable { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. func apiInsightsGetTimeStatsByUser(_ input: Operations.ApiInsightsGetTimeStatsByUser.Input) async throws -> Operations.ApiInsightsGetTimeStatsByUser.Output @@ -401,6 +432,8 @@ public protocol APIProtocol: Sendable { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. func apiInsightsGetTimeStatsByActor(_ input: Operations.ApiInsightsGetTimeStatsByActor.Input) async throws -> Operations.ApiInsightsGetTimeStatsByActor.Output @@ -408,6 +441,8 @@ public protocol APIProtocol: Sendable { /// /// Get API usage statistics within an organization for a user broken down by the type of access. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. func apiInsightsGetUserStats(_ input: Operations.ApiInsightsGetUserStats.Input) async throws -> Operations.ApiInsightsGetUserStats.Output @@ -1217,6 +1252,41 @@ extension APIProtocol { body: body )) } + /// Create a cluster deployment records job + /// + /// Create a background job to set deployment records for a given cluster. + /// Performs validation and permission checks synchronously, returning rejected + /// deployments immediately, then enqueues a background job for the actual + /// deployment updates. Use the companion GET endpoint to poll for job status. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)`. + public func orgsCreateClusterDeploymentRecordsJob( + path: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Path, + headers: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Headers = .init(), + body: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body + ) async throws -> Operations.OrgsCreateClusterDeploymentRecordsJob.Output { + try await orgsCreateClusterDeploymentRecordsJob(Operations.OrgsCreateClusterDeploymentRecordsJob.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get cluster deployment records job status + /// + /// Get the status and results of a previously created cluster deployment records job. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/get(orgs/get-cluster-deployment-records-job)`. + public func orgsGetClusterDeploymentRecordsJob( + path: Operations.OrgsGetClusterDeploymentRecordsJob.Input.Path, + headers: Operations.OrgsGetClusterDeploymentRecordsJob.Input.Headers = .init() + ) async throws -> Operations.OrgsGetClusterDeploymentRecordsJob.Output { + try await orgsGetClusterDeploymentRecordsJob(Operations.OrgsGetClusterDeploymentRecordsJob.Input( + path: path, + headers: headers + )) + } /// Create artifact metadata storage record /// /// Create metadata storage records for artifacts associated with an organization. @@ -1690,6 +1760,8 @@ extension APIProtocol { /// /// Get API request count statistics for an actor broken down by route within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. public func apiInsightsGetRouteStatsByActor( @@ -1707,6 +1779,8 @@ extension APIProtocol { /// /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. public func apiInsightsGetSubjectStats( @@ -1724,6 +1798,8 @@ extension APIProtocol { /// /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. public func apiInsightsGetSummaryStats( @@ -1741,6 +1817,8 @@ extension APIProtocol { /// /// Get overall statistics of API requests within the organization for a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. public func apiInsightsGetSummaryStatsByUser( @@ -1758,6 +1836,8 @@ extension APIProtocol { /// /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. public func apiInsightsGetSummaryStatsByActor( @@ -1775,6 +1855,8 @@ extension APIProtocol { /// /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. public func apiInsightsGetTimeStats( @@ -1792,6 +1874,8 @@ extension APIProtocol { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. public func apiInsightsGetTimeStatsByUser( @@ -1809,6 +1893,8 @@ extension APIProtocol { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. public func apiInsightsGetTimeStatsByActor( @@ -1826,6 +1912,8 @@ extension APIProtocol { /// /// Get API usage statistics within an organization for a user broken down by the type of access. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. public func apiInsightsGetUserStats( @@ -3960,7 +4048,7 @@ public enum Components { case response } } - /// The permissions granted to the user access token. + /// The permissions granted to the fine-grained access token. /// /// - Remark: Generated from `#/components/schemas/app-permissions`. public struct AppPermissions: Codable, Hashable, Sendable { @@ -12084,6 +12172,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/deployments`. public var deployments: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayload + /// When enabled, deployments associated with repositories the actor can write to are processed + /// while deployments associated with repositories that cannot be resolved or written to by the actor + /// are skipped and reported in the `errors` array. When false (the default), the endpoint returns + /// an error if any targeted repository cannot be resolved, the actor lacks write access, or no matching attestation can be found. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/partial_success`. + public var partialSuccess: Swift.Bool? /// If true, the endpoint will return the set records in the response body /// /// @@ -12095,81 +12191,1157 @@ public enum Operations { /// - logicalEnvironment: The stage of the deployment. /// - physicalEnvironment: The physical region of the deployment. /// - deployments: The list of deployments to record. + /// - partialSuccess: When enabled, deployments associated with repositories the actor can write to are processed /// - returnRecords: If true, the endpoint will return the set records in the response body public init( logicalEnvironment: Swift.String, physicalEnvironment: Swift.String? = nil, deployments: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayload, + partialSuccess: Swift.Bool? = nil, returnRecords: Swift.Bool? = nil ) { self.logicalEnvironment = logicalEnvironment self.physicalEnvironment = physicalEnvironment self.deployments = deployments + self.partialSuccess = partialSuccess self.returnRecords = returnRecords } - public enum CodingKeys: String, CodingKey { - case logicalEnvironment = "logical_environment" - case physicalEnvironment = "physical_environment" - case deployments - case returnRecords = "return_records" + public enum CodingKeys: String, CodingKey { + case logicalEnvironment = "logical_environment" + case physicalEnvironment = "physical_environment" + case deployments + case partialSuccess = "partial_success" + case returnRecords = "return_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/content/application\/json`. + case json(Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload) + } + public var body: Operations.OrgsSetClusterDeploymentRecords.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsSetClusterDeploymentRecords.Input.Path, + headers: Operations.OrgsSetClusterDeploymentRecords.Input.Headers = .init(), + body: Operations.OrgsSetClusterDeploymentRecords.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of deployment records created + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json/deployment_records`. + public var deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of deployment records created + /// - deploymentRecords: + public init( + totalCount: Swift.Int, + deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil + ) { + self.totalCount = totalCount + self.deploymentRecords = deploymentRecords + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case deploymentRecords = "deployment_records" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/application\/json`. + case json(Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body) { + self.body = body + } + } + /// Deployment records created or updated successfully. + /// + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.OrgsSetClusterDeploymentRecords.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.OrgsSetClusterDeploymentRecords.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct Code207: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The number of deployment records created or updated. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/deployment_records`. + public var deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// The reason the deployment failed processing. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/cause`. + @frozen public enum CausePayload: String, Codable, Hashable, Sendable, CaseIterable { + case unauthorized = "unauthorized" + case notFound = "not_found" + } + /// The reason the deployment failed processing. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/cause`. + public var cause: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayloadPayload.CausePayload? + /// The deployment payload that could not be processed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment`. + public struct DeploymentPayload: Codable, Hashable, Sendable { + /// The name of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/name`. + public var name: Swift.String? + /// The digest of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/digest`. + public var digest: Swift.String? + /// The name of the deployment that failed processing. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/deployment_name`. + public var deploymentName: Swift.String? + /// The version of the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/version`. + public var version: Swift.String? + /// The deployment status. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/status`. + public var status: Swift.String? + /// The repository associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/github_repository`. + public var githubRepository: Swift.String? + /// Custom metadata tags for the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/tags`. + public struct TagsPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `TagsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Swift.String] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Custom metadata tags for the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/tags`. + public var tags: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayloadPayload.DeploymentPayload.TagsPayload? + /// Runtime risk classifications for the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment/runtime_risks`. + public var runtimeRisks: [Swift.String]? + /// Creates a new `DeploymentPayload`. + /// + /// - Parameters: + /// - name: The name of the artifact. + /// - digest: The digest of the artifact. + /// - deploymentName: The name of the deployment that failed processing. + /// - version: The version of the deployment. + /// - status: The deployment status. + /// - githubRepository: The repository associated with the deployment. + /// - tags: Custom metadata tags for the deployment. + /// - runtimeRisks: Runtime risk classifications for the deployment. + public init( + name: Swift.String? = nil, + digest: Swift.String? = nil, + deploymentName: Swift.String? = nil, + version: Swift.String? = nil, + status: Swift.String? = nil, + githubRepository: Swift.String? = nil, + tags: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayloadPayload.DeploymentPayload.TagsPayload? = nil, + runtimeRisks: [Swift.String]? = nil + ) { + self.name = name + self.digest = digest + self.deploymentName = deploymentName + self.version = version + self.status = status + self.githubRepository = githubRepository + self.tags = tags + self.runtimeRisks = runtimeRisks + } + public enum CodingKeys: String, CodingKey { + case name + case digest + case deploymentName = "deployment_name" + case version + case status + case githubRepository = "github_repository" + case tags + case runtimeRisks = "runtime_risks" + } + } + /// The deployment payload that could not be processed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/ErrorsPayload/deployment`. + public var deployment: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayloadPayload.DeploymentPayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - cause: The reason the deployment failed processing. + /// - deployment: The deployment payload that could not be processed. + public init( + cause: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayloadPayload.CausePayload? = nil, + deployment: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayloadPayload.DeploymentPayload? = nil + ) { + self.cause = cause + self.deployment = deployment + } + public enum CodingKeys: String, CodingKey { + case cause + case deployment + } + } + /// A list of errors for deployments that could not be processed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/errors`. + public typealias ErrorsPayload = [Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayloadPayload] + /// A list of errors for deployments that could not be processed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/json/errors`. + public var errors: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: The number of deployment records created or updated. + /// - deploymentRecords: + /// - errors: A list of errors for deployments that could not be processed. + public init( + totalCount: Swift.Int, + deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil, + errors: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload.ErrorsPayload? = nil + ) { + self.totalCount = totalCount + self.deploymentRecords = deploymentRecords + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case deploymentRecords = "deployment_records" + case errors + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/207/content/application\/json`. + case json(Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body + /// Creates a new `Code207`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.Code207.Body) { + self.body = body + } + } + /// This response format is only returned when `partial_success` is set to true in the request body. + /// Successfully processed deployments are included in the `deployment_records` field. Records that could + /// not be processed and were skipped because of unresolvable repositories, missing actor permissions, or lack of a matching attestation are + /// included in the `errors` field. + /// + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/207`. + /// + /// HTTP response code: `207 code207`. + case code207(Operations.OrgsSetClusterDeploymentRecords.Output.Code207) + /// The associated value of the enum case if `self` is `.code207`. + /// + /// - Throws: An error if `self` is not `.code207`. + /// - SeeAlso: `.code207`. + public var code207: Operations.OrgsSetClusterDeploymentRecords.Output.Code207 { + get throws { + switch self { + case let .code207(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "code207", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/403/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/404/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsSetClusterDeploymentRecords.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.OrgsSetClusterDeploymentRecords.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.OrgsSetClusterDeploymentRecords.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a cluster deployment records job + /// + /// Create a background job to set deployment records for a given cluster. + /// Performs validation and permission checks synchronously, returning rejected + /// deployments immediately, then enqueues a background job for the actual + /// deployment updates. Use the companion GET endpoint to poll for job status. + /// + /// - Remark: HTTP `POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)`. + public enum OrgsCreateClusterDeploymentRecordsJob { + public static let id: Swift.String = "orgs/create-cluster-deployment-records-job" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/path/org`. + public var org: Components.Parameters.Org + /// The cluster name. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/path/cluster`. + public var cluster: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - cluster: The cluster name. + public init( + org: Components.Parameters.Org, + cluster: Swift.String + ) { + self.org = org + self.cluster = cluster + } + } + public var path: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/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.OrgsCreateClusterDeploymentRecordsJob.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The stage of the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/logical_environment`. + public var logicalEnvironment: Swift.String + /// The physical region of the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/physical_environment`. + public var physicalEnvironment: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload`. + public struct DeploymentsPayloadPayload: Codable, Hashable, Sendable { + /// The name of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/name`. + public var name: Swift.String + /// The hex encoded digest of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/digest`. + public var digest: Swift.String + /// The artifact version. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/version`. + public var version: Swift.String? + /// The deployment status of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case deployed = "deployed" + case decommissioned = "decommissioned" + } + /// The deployment status of the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/status`. + public var status: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload.StatusPayload? + /// The unique identifier for the deployment represented by the new record. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/deployment_name`. + public var deploymentName: Swift.String + /// The name of the GitHub repository associated with the artifact. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/github_repository`. + public var githubRepository: Swift.String? + /// Key-value pairs to tag the deployment record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/tags`. + public struct TagsPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: [String: Swift.String] + /// Creates a new `TagsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Swift.String] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Key-value pairs to tag the deployment record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/tags`. + public var tags: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload.TagsPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/RuntimeRisksPayload`. + @frozen public enum RuntimeRisksPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case criticalResource = "critical-resource" + case internetExposed = "internet-exposed" + case lateralMovement = "lateral-movement" + case sensitiveData = "sensitive-data" + } + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/runtime_risks`. + public typealias RuntimeRisksPayload = [Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload.RuntimeRisksPayloadPayload] + /// A list of runtime risks associated with the deployment. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/DeploymentsPayload/runtime_risks`. + public var runtimeRisks: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload.RuntimeRisksPayload? + /// Creates a new `DeploymentsPayloadPayload`. + /// + /// - Parameters: + /// - name: The name of the artifact. + /// - digest: The hex encoded digest of the artifact. + /// - version: The artifact version. + /// - status: The deployment status of the artifact. + /// - deploymentName: The unique identifier for the deployment represented by the new record. + /// - githubRepository: The name of the GitHub repository associated with the artifact. + /// - tags: Key-value pairs to tag the deployment record. + /// - runtimeRisks: A list of runtime risks associated with the deployment. + public init( + name: Swift.String, + digest: Swift.String, + version: Swift.String? = nil, + status: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload.StatusPayload? = nil, + deploymentName: Swift.String, + githubRepository: Swift.String? = nil, + tags: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload.TagsPayload? = nil, + runtimeRisks: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload.RuntimeRisksPayload? = nil + ) { + self.name = name + self.digest = digest + self.version = version + self.status = status + self.deploymentName = deploymentName + self.githubRepository = githubRepository + self.tags = tags + self.runtimeRisks = runtimeRisks + } + public enum CodingKeys: String, CodingKey { + case name + case digest + case version + case status + case deploymentName = "deployment_name" + case githubRepository = "github_repository" + case tags + case runtimeRisks = "runtime_risks" + } + } + /// The list of deployments to record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/deployments`. + public typealias DeploymentsPayload = [Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayloadPayload] + /// The list of deployments to record. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/json/deployments`. + public var deployments: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - logicalEnvironment: The stage of the deployment. + /// - physicalEnvironment: The physical region of the deployment. + /// - deployments: The list of deployments to record. + public init( + logicalEnvironment: Swift.String, + physicalEnvironment: Swift.String? = nil, + deployments: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload.DeploymentsPayload + ) { + self.logicalEnvironment = logicalEnvironment + self.physicalEnvironment = physicalEnvironment + self.deployments = deployments + } + public enum CodingKeys: String, CodingKey { + case logicalEnvironment = "logical_environment" + case physicalEnvironment = "physical_environment" + case deployments + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/requestBody/content/application\/json`. + case json(Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body.JsonPayload) + } + public var body: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Path, + headers: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Headers = .init(), + body: Operations.OrgsCreateClusterDeploymentRecordsJob.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/202/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/202/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The ID of the created job. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/202/content/json/job_id`. + public var jobId: Swift.Int + /// Deployments that were rejected during authorization. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/202/content/json/errors`. + public var errors: [OpenAPIRuntime.OpenAPIObjectContainer]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - jobId: The ID of the created job. + /// - errors: Deployments that were rejected during authorization. + public init( + jobId: Swift.Int, + errors: [OpenAPIRuntime.OpenAPIObjectContainer]? = nil + ) { + self.jobId = jobId + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case jobId = "job_id" + case errors + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/202/content/application\/json`. + case json(Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted.Body + /// Creates a new `Accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted.Body) { + self.body = body + } + } + /// Job created successfully. Authorized deployments will be processed in the background. + /// + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/400/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.OrgsCreateClusterDeploymentRecordsJob.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/403/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Forbidden.Body) { + self.body = body + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/404/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.OrgsCreateClusterDeploymentRecordsJob.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.OrgsCreateClusterDeploymentRecordsJob.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/POST/responses/409/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Conflict.Body) { + self.body = body + } + } + /// A job is already in progress for this cluster. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/post(orgs/create-cluster-deployment-records-job)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.OrgsCreateClusterDeploymentRecordsJob.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) } } - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/content/application\/json`. - case json(Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload) } - public var body: Operations.OrgsSetClusterDeploymentRecords.Input.Body + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get cluster deployment records job status + /// + /// Get the status and results of a previously created cluster deployment records job. + /// + /// - Remark: HTTP `GET /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/get(orgs/get-cluster-deployment-records-job)`. + public enum OrgsGetClusterDeploymentRecordsJob { + public static let id: Swift.String = "orgs/get-cluster-deployment-records-job" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/path/org`. + public var org: Components.Parameters.Org + /// The cluster name. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/path/cluster`. + public var cluster: Swift.String + /// The ID of the job. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/path/job_id`. + public var jobId: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - cluster: The cluster name. + /// - jobId: The ID of the job. + public init( + org: Components.Parameters.Org, + cluster: Swift.String, + jobId: Swift.Int + ) { + self.org = org + self.cluster = cluster + self.jobId = jobId + } + } + public var path: Operations.OrgsGetClusterDeploymentRecordsJob.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.OrgsGetClusterDeploymentRecordsJob.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.OrgsSetClusterDeploymentRecords.Input.Path, - headers: Operations.OrgsSetClusterDeploymentRecords.Input.Headers = .init(), - body: Operations.OrgsSetClusterDeploymentRecords.Input.Body + path: Operations.OrgsGetClusterDeploymentRecordsJob.Input.Path, + headers: Operations.OrgsGetClusterDeploymentRecordsJob.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The number of deployment records created + /// The ID of the job. /// - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/json/deployment_records`. - public var deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/json/job_id`. + public var jobId: Swift.Int + /// The current status of the job. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/json/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case pending = "pending" + case processing = "processing" + case completed = "completed" + case failed = "failed" + } + /// The current status of the job. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/json/status`. + public var status: Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body.JsonPayload.StatusPayload + /// When the job started processing (only present when processing, completed, or failed). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/json/started_at`. + public var startedAt: Foundation.Date? + /// The number of records successfully mutated (only present when completed). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int? + /// Processing errors (only present when completed or failed). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/json/errors`. + public var errors: [OpenAPIRuntime.OpenAPIObjectContainer]? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - totalCount: The number of deployment records created - /// - deploymentRecords: + /// - jobId: The ID of the job. + /// - status: The current status of the job. + /// - startedAt: When the job started processing (only present when processing, completed, or failed). + /// - totalCount: The number of records successfully mutated (only present when completed). + /// - errors: Processing errors (only present when completed or failed). public init( - totalCount: Swift.Int, - deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil + jobId: Swift.Int, + status: Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body.JsonPayload.StatusPayload, + startedAt: Foundation.Date? = nil, + totalCount: Swift.Int? = nil, + errors: [OpenAPIRuntime.OpenAPIObjectContainer]? = nil ) { + self.jobId = jobId + self.status = status + self.startedAt = startedAt self.totalCount = totalCount - self.deploymentRecords = deploymentRecords + self.errors = errors } public enum CodingKeys: String, CodingKey { + case jobId = "job_id" + case status + case startedAt = "started_at" case totalCount = "total_count" - case deploymentRecords = "deployment_records" + case errors } } - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/200/content/application\/json`. - case json(Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/200/content/application\/json`. + case json(Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body.JsonPayload { + public var json: Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -12179,27 +13351,27 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body + public var body: Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.Ok.Body) { + public init(body: Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok.Body) { self.body = body } } - /// Deployment records created or updated successfully. + /// Job status retrieved successfully. /// /// - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/get(orgs/get-cluster-deployment-records-job)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.OrgsSetClusterDeploymentRecords.Output.Ok) + case ok(Operations.OrgsGetClusterDeploymentRecordsJob.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.OrgsSetClusterDeploymentRecords.Output.Ok { + public var ok: Operations.OrgsGetClusterDeploymentRecordsJob.Output.Ok { get throws { switch self { case let .ok(response): @@ -12212,61 +13384,10 @@ public enum Operations { } } } - public struct Forbidden: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/403/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/403/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden.Body - /// Creates a new `Forbidden`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden.Body) { - self.body = body - } - } - /// Forbidden - /// - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden) - /// The associated value of the enum case if `self` is `.forbidden`. - /// - /// - Throws: An error if `self` is not `.forbidden`. - /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.OrgsSetClusterDeploymentRecords.Output.Forbidden { - get throws { - switch self { - case let .forbidden(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "forbidden", - response: self - ) - } - } - } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/GET/responses/404/content/application\/json`. case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// @@ -12282,26 +13403,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.OrgsSetClusterDeploymentRecords.Output.NotFound.Body + public var body: Operations.OrgsGetClusterDeploymentRecordsJob.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.OrgsSetClusterDeploymentRecords.Output.NotFound.Body) { + public init(body: Operations.OrgsGetClusterDeploymentRecordsJob.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/post(orgs/set-cluster-deployment-records)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/jobs/{job_id}/get(orgs/get-cluster-deployment-records-job)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.OrgsSetClusterDeploymentRecords.Output.NotFound) + case notFound(Operations.OrgsGetClusterDeploymentRecordsJob.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.OrgsSetClusterDeploymentRecords.Output.NotFound { + public var notFound: Operations.OrgsGetClusterDeploymentRecordsJob.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -17641,6 +18762,8 @@ public enum Operations { /// /// Get API request count statistics for an actor broken down by route within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. public enum ApiInsightsGetRouteStatsByActor { @@ -17875,6 +18998,8 @@ public enum Operations { /// /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. public enum ApiInsightsGetSubjectStats { @@ -18084,6 +19209,8 @@ public enum Operations { /// /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. public enum ApiInsightsGetSummaryStats { @@ -18243,6 +19370,8 @@ public enum Operations { /// /// Get overall statistics of API requests within the organization for a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. public enum ApiInsightsGetSummaryStatsByUser { @@ -18411,6 +19540,8 @@ public enum Operations { /// /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. public enum ApiInsightsGetSummaryStatsByActor { @@ -18594,6 +19725,8 @@ public enum Operations { /// /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. public enum ApiInsightsGetTimeStats { @@ -18760,6 +19893,8 @@ public enum Operations { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. public enum ApiInsightsGetTimeStatsByUser { @@ -18935,6 +20070,8 @@ public enum Operations { /// /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. public enum ApiInsightsGetTimeStatsByActor { @@ -19125,6 +20262,8 @@ public enum Operations { /// /// Get API usage statistics within an organization for a user broken down by the type of access. /// + /// Under normal conditions, you can expect API data to appear within 4–6 hours after making a request. During incidents or periods of unusually high volume, it may take longer to show up. + /// /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. public enum ApiInsightsGetUserStats { @@ -31562,7 +32701,7 @@ public enum Operations { self.body = body } } - /// Response + /// The user's organization invitation was accepted synchronously. /// /// - Remark: Generated from `#/paths//user/memberships/orgs/{org}/patch(orgs/update-membership-for-authenticated-user)/responses/200`. /// @@ -31585,6 +32724,57 @@ public enum Operations { } } } + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/memberships/orgs/{org}/PATCH/responses/202/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/user/memberships/orgs/{org}/PATCH/responses/202/content/application\/json`. + case json(Components.Schemas.OrgMembership) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.OrgMembership { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.OrgsUpdateMembershipForAuthenticatedUser.Output.Accepted.Body + /// Creates a new `Accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.OrgsUpdateMembershipForAuthenticatedUser.Output.Accepted.Body) { + self.body = body + } + } + /// The acceptance of the user's organization invitation is being processed asynchronously. + /// + /// - Remark: Generated from `#/paths//user/memberships/orgs/{org}/patch(orgs/update-membership-for-authenticated-user)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Operations.OrgsUpdateMembershipForAuthenticatedUser.Output.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.OrgsUpdateMembershipForAuthenticatedUser.Output.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } /// Forbidden /// /// - Remark: Generated from `#/paths//user/memberships/orgs/{org}/patch(orgs/update-membership-for-authenticated-user)/responses/403`. From 473ee45cba5700bf41d9229eed94ca4eddeda033 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:42:02 +0000 Subject: [PATCH 09/18] Commit via running: make Sources/pulls --- Sources/pulls/Client.swift | 619 +++++++++ Sources/pulls/Types.swift | 2620 +++++++++++++++++++++++++++++++++++- 2 files changed, 3175 insertions(+), 64 deletions(-) diff --git a/Sources/pulls/Client.swift b/Sources/pulls/Client.swift index 5b2413c490..8e34d5d357 100644 --- a/Sources/pulls/Client.swift +++ b/Sources/pulls/Client.swift @@ -3213,4 +3213,623 @@ public struct Client: APIProtocol { } ) } + /// List pull request stacks + /// + /// Lists pull request stacks in a repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/get(pull-request-stacks/list)`. + public func pullRequestStacksList(_ input: Operations.PullRequestStacksList.Input) async throws -> Operations.PullRequestStacksList.Output { + try await client.send( + input: input, + forOperation: Operations.PullRequestStacksList.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/stacks", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "pull_request", + value: input.query.pullRequest + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksList.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.PullRequestStackMinimal].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Create a pull request stack + /// + /// Creates a stack from an ordered list of pull request numbers. Provide the pull + /// request numbers from the bottom of the stack to the top. Each pull request's + /// base ref must match the previous pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/post(pull-request-stacks/create)`. + public func pullRequestStacksCreate(_ input: Operations.PullRequestStacksCreate.Input) async throws -> Operations.PullRequestStacksCreate.Output { + try await client.send( + input: input, + forOperation: Operations.PullRequestStacksCreate.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/stacks", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksCreate.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.PullRequestStacksCreate.Output.Created.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a pull request stack + /// + /// Gets a pull request stack by providing its stack number. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks/{stack_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/get(pull-request-stacks/get)`. + public func pullRequestStacksGet(_ input: Operations.PullRequestStacksGet.Input) async throws -> Operations.PullRequestStacksGet.Output { + try await client.send( + input: input, + forOperation: Operations.PullRequestStacksGet.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/stacks/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.stackNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksGet.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.PullRequestStacksGet.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Add pull requests to a pull request stack + /// + /// Appends an ordered list of pull request numbers onto the top of an existing + /// stack. Provide only the pull requests you want to add, from the current top of + /// the stack upward. The first new pull request's base ref must match the current + /// top pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/add`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/add/post(pull-request-stacks/add)`. + public func pullRequestStacksAdd(_ input: Operations.PullRequestStacksAdd.Input) async throws -> Operations.PullRequestStacksAdd.Output { + try await client.send( + input: input, + forOperation: Operations.PullRequestStacksAdd.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/stacks/{}/add", + parameters: [ + input.path.owner, + input.path.repo, + input.path.stackNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksAdd.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.PullRequestStacksAdd.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksAdd.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove pull requests from a pull request stack + /// + /// Removes the unmerged pull requests from a stack. Pull requests that cannot be + /// unstacked (for example, those that are queued for merge) are left in place. When pull requests remain in the stack, the updated + /// stack is returned with a `200`. When no pull requests remain, the stack is + /// dissolved and a `204` is returned. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/unstack`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)`. + public func pullRequestStacksUnstack(_ input: Operations.PullRequestStacksUnstack.Input) async throws -> Operations.PullRequestStacksUnstack.Output { + try await client.send( + input: input, + forOperation: Operations.PullRequestStacksUnstack.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/stacks/{}/unstack", + parameters: [ + input.path.owner, + input.path.repo, + input.path.stackNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksUnstack.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.PullRequestStacksUnstack.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksUnstack.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PullRequestStacksUnstack.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + case 204: + return .noContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } } diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 27beb0d077..7a25b2b599 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -399,6 +399,49 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/pulls/{pull_number}/update-branch/put(pulls/update-branch)`. func pullsUpdateBranch(_ input: Operations.PullsUpdateBranch.Input) async throws -> Operations.PullsUpdateBranch.Output + /// List pull request stacks + /// + /// Lists pull request stacks in a repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/get(pull-request-stacks/list)`. + func pullRequestStacksList(_ input: Operations.PullRequestStacksList.Input) async throws -> Operations.PullRequestStacksList.Output + /// Create a pull request stack + /// + /// Creates a stack from an ordered list of pull request numbers. Provide the pull + /// request numbers from the bottom of the stack to the top. Each pull request's + /// base ref must match the previous pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/post(pull-request-stacks/create)`. + func pullRequestStacksCreate(_ input: Operations.PullRequestStacksCreate.Input) async throws -> Operations.PullRequestStacksCreate.Output + /// Get a pull request stack + /// + /// Gets a pull request stack by providing its stack number. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks/{stack_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/get(pull-request-stacks/get)`. + func pullRequestStacksGet(_ input: Operations.PullRequestStacksGet.Input) async throws -> Operations.PullRequestStacksGet.Output + /// Add pull requests to a pull request stack + /// + /// Appends an ordered list of pull request numbers onto the top of an existing + /// stack. Provide only the pull requests you want to add, from the current top of + /// the stack upward. The first new pull request's base ref must match the current + /// top pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/add`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/add/post(pull-request-stacks/add)`. + func pullRequestStacksAdd(_ input: Operations.PullRequestStacksAdd.Input) async throws -> Operations.PullRequestStacksAdd.Output + /// Remove pull requests from a pull request stack + /// + /// Removes the unmerged pull requests from a stack. Pull requests that cannot be + /// unstacked (for example, those that are queued for merge) are left in place. When pull requests remain in the stack, the updated + /// stack is returned with a `200`. When no pull requests remain, the stack is + /// dissolved and a `204` is returned. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/unstack`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)`. + func pullRequestStacksUnstack(_ input: Operations.PullRequestStacksUnstack.Input) async throws -> Operations.PullRequestStacksUnstack.Output } /// Convenience overloads for operation inputs. @@ -1041,6 +1084,95 @@ extension APIProtocol { body: body )) } + /// List pull request stacks + /// + /// Lists pull request stacks in a repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/get(pull-request-stacks/list)`. + public func pullRequestStacksList( + path: Operations.PullRequestStacksList.Input.Path, + query: Operations.PullRequestStacksList.Input.Query = .init(), + headers: Operations.PullRequestStacksList.Input.Headers = .init() + ) async throws -> Operations.PullRequestStacksList.Output { + try await pullRequestStacksList(Operations.PullRequestStacksList.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a pull request stack + /// + /// Creates a stack from an ordered list of pull request numbers. Provide the pull + /// request numbers from the bottom of the stack to the top. Each pull request's + /// base ref must match the previous pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/post(pull-request-stacks/create)`. + public func pullRequestStacksCreate( + path: Operations.PullRequestStacksCreate.Input.Path, + headers: Operations.PullRequestStacksCreate.Input.Headers = .init(), + body: Operations.PullRequestStacksCreate.Input.Body + ) async throws -> Operations.PullRequestStacksCreate.Output { + try await pullRequestStacksCreate(Operations.PullRequestStacksCreate.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a pull request stack + /// + /// Gets a pull request stack by providing its stack number. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks/{stack_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/get(pull-request-stacks/get)`. + public func pullRequestStacksGet( + path: Operations.PullRequestStacksGet.Input.Path, + headers: Operations.PullRequestStacksGet.Input.Headers = .init() + ) async throws -> Operations.PullRequestStacksGet.Output { + try await pullRequestStacksGet(Operations.PullRequestStacksGet.Input( + path: path, + headers: headers + )) + } + /// Add pull requests to a pull request stack + /// + /// Appends an ordered list of pull request numbers onto the top of an existing + /// stack. Provide only the pull requests you want to add, from the current top of + /// the stack upward. The first new pull request's base ref must match the current + /// top pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/add`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/add/post(pull-request-stacks/add)`. + public func pullRequestStacksAdd( + path: Operations.PullRequestStacksAdd.Input.Path, + headers: Operations.PullRequestStacksAdd.Input.Headers = .init(), + body: Operations.PullRequestStacksAdd.Input.Body + ) async throws -> Operations.PullRequestStacksAdd.Output { + try await pullRequestStacksAdd(Operations.PullRequestStacksAdd.Input( + path: path, + headers: headers, + body: body + )) + } + /// Remove pull requests from a pull request stack + /// + /// Removes the unmerged pull requests from a stack. Pull requests that cannot be + /// unstacked (for example, those that are queued for merge) are left in place. When pull requests remain in the stack, the updated + /// stack is returned with a `200`. When no pull requests remain, the stack is + /// dissolved and a `204` is returned. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/unstack`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)`. + public func pullRequestStacksUnstack( + path: Operations.PullRequestStacksUnstack.Input.Path, + headers: Operations.PullRequestStacksUnstack.Input.Headers = .init() + ) async throws -> Operations.PullRequestStacksUnstack.Output { + try await pullRequestStacksUnstack(Operations.PullRequestStacksUnstack.Input( + path: path, + headers: headers + )) + } } /// Server URLs defined in the OpenAPI document. @@ -2600,6 +2732,163 @@ public enum Components { case rocket } } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal`. + public struct PullRequestMinimal: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. + /// + /// - Parameters: + /// - id: + /// - url: + /// - name: + public init( + id: Swift.Int64, + url: Swift.String, + name: Swift.String + ) { + self.id = id + self.url = url + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case url + case name + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head/repo`. + public var repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - ref: + /// - sha: + /// - repo: + public init( + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.HeadPayload.RepoPayload + ) { + self.ref = ref + self.sha = sha + self.repo = repo + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + case repo + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/head`. + public var head: Components.Schemas.PullRequestMinimal.HeadPayload + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/sha`. + public var sha: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public struct RepoPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo/name`. + public var name: Swift.String + /// Creates a new `RepoPayload`. + /// + /// - Parameters: + /// - id: + /// - url: + /// - name: + public init( + id: Swift.Int64, + url: Swift.String, + name: Swift.String + ) { + self.id = id + self.url = url + self.name = name + } + public enum CodingKeys: String, CodingKey { + case id + case url + case name + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base/repo`. + public var repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: + /// - sha: + /// - repo: + public init( + ref: Swift.String, + sha: Swift.String, + repo: Components.Schemas.PullRequestMinimal.BasePayload.RepoPayload + ) { + self.ref = ref + self.sha = sha + self.repo = repo + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + case repo + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-minimal/base`. + public var base: Components.Schemas.PullRequestMinimal.BasePayload + /// Creates a new `PullRequestMinimal`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - url: + /// - head: + /// - base: + public init( + id: Swift.Int64, + number: Swift.Int, + url: Swift.String, + head: Components.Schemas.PullRequestMinimal.HeadPayload, + base: Components.Schemas.PullRequestMinimal.BasePayload + ) { + self.id = id + self.number = number + self.url = url + self.head = head + self.base = base + } + public enum CodingKeys: String, CodingKey { + case id + case number + case url + case head + case base + } + } /// An object without any properties. /// /// - Remark: Generated from `#/components/schemas/empty-object`. @@ -3143,6 +3432,84 @@ public enum Components { case commitMessage = "commit_message" } } + /// The stack information associated with a pull request. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack`. + public struct PullRequestStack: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// The base ref of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/ref`. + public var ref: Swift.String + /// The base SHA of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/sha`. + public var sha: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: The base ref of the stack this pull request belongs to. + /// - sha: The base SHA of the stack this pull request belongs to. + public init( + ref: Swift.String, + sha: Swift.String + ) { + self.ref = ref + self.sha = sha + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public var base: Components.Schemas.PullRequestStack.BasePayload + /// The total number of pull requests in the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/size`. + public var size: Swift.Int? + /// The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/position`. + public var position: Swift.Int? + /// The ID of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/id`. + public var id: Swift.Int? + /// The number of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/number`. + public var number: Swift.Int? + /// Creates a new `PullRequestStack`. + /// + /// - Parameters: + /// - base: + /// - size: The total number of pull requests in the stack. + /// - position: The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// - id: The ID of the stack that this pull request belongs to. + /// - number: The number of the stack that this pull request belongs to. + public init( + base: Components.Schemas.PullRequestStack.BasePayload, + size: Swift.Int? = nil, + position: Swift.Int? = nil, + id: Swift.Int? = nil, + number: Swift.Int? = nil + ) { + self.base = base + self.size = size + self.position = position + self.id = id + self.number = number + } + public enum CodingKeys: String, CodingKey { + case base + case size + case position + case id + case number + } + } /// Pull Request Simple /// /// - Remark: Generated from `#/components/schemas/pull-request-simple`. @@ -3413,6 +3780,8 @@ public enum Components { public var authorAssociation: Components.Schemas.AuthorAssociation /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. public var autoMerge: Components.Schemas.AutoMerge? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/stack`. + public var stack: Components.Schemas.PullRequestStack? /// Indicates whether or not the pull request is a draft. /// /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. @@ -3455,6 +3824,7 @@ public enum Components { /// - _links: /// - authorAssociation: /// - autoMerge: + /// - stack: /// - draft: Indicates whether or not the pull request is a draft. public init( url: Swift.String, @@ -3492,6 +3862,7 @@ public enum Components { _links: Components.Schemas.PullRequestSimple._LinksPayload, authorAssociation: Components.Schemas.AuthorAssociation, autoMerge: Components.Schemas.AutoMerge? = nil, + stack: Components.Schemas.PullRequestStack? = nil, draft: Swift.Bool? = nil ) { self.url = url @@ -3529,6 +3900,7 @@ public enum Components { self._links = _links self.authorAssociation = authorAssociation self.autoMerge = autoMerge + self.stack = stack self.draft = draft } public enum CodingKeys: String, CodingKey { @@ -3567,6 +3939,7 @@ public enum Components { case _links case authorAssociation = "author_association" case autoMerge = "auto_merge" + case stack case draft } } @@ -4623,6 +4996,8 @@ public enum Components { public var authorAssociation: Components.Schemas.AuthorAssociation /// - Remark: Generated from `#/components/schemas/pull-request/auto_merge`. public var autoMerge: Components.Schemas.AutoMerge? + /// - Remark: Generated from `#/components/schemas/pull-request/stack`. + public var stack: Components.Schemas.PullRequestStack? /// Indicates whether or not the pull request is a draft. /// /// - Remark: Generated from `#/components/schemas/pull-request/draft`. @@ -4691,6 +5066,7 @@ public enum Components { /// - _links: /// - authorAssociation: /// - autoMerge: + /// - stack: /// - draft: Indicates whether or not the pull request is a draft. /// - merged: /// - mergeable: @@ -4740,6 +5116,7 @@ public enum Components { _links: Components.Schemas.PullRequest._LinksPayload, authorAssociation: Components.Schemas.AuthorAssociation, autoMerge: Components.Schemas.AutoMerge? = nil, + stack: Components.Schemas.PullRequestStack? = nil, draft: Swift.Bool? = nil, merged: Swift.Bool, mergeable: Swift.Bool? = nil, @@ -4789,6 +5166,7 @@ public enum Components { self._links = _links self.authorAssociation = authorAssociation self.autoMerge = autoMerge + self.stack = stack self.draft = draft self.merged = merged self.mergeable = mergeable @@ -4839,6 +5217,7 @@ public enum Components { case _links case authorAssociation = "author_association" case autoMerge = "auto_merge" + case stack case draft case merged case mergeable @@ -5311,73 +5690,305 @@ public enum Components { case subjectType = "subject_type" } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/per-page`. - public typealias PerPage = Swift.Int - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/page`. - public typealias Page = Swift.Int - /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - /// - /// - Remark: Generated from `#/components/parameters/since`. - public typealias Since = Foundation.Date - /// The unique identifier of the comment. - /// - /// - Remark: Generated from `#/components/parameters/comment-id`. - public typealias CommentId = Swift.Int64 - /// The property to sort the results by. - /// - /// - Remark: Generated from `#/components/parameters/sort`. - @frozen public enum Sort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" - } - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String - /// The number that identifies the pull request. - /// - /// - Remark: Generated from `#/components/parameters/pull-number`. - public typealias PullNumber = Swift.Int - /// The unique identifier of the review. - /// - /// - Remark: Generated from `#/components/parameters/review-id`. - public typealias ReviewId = Swift.Int - } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct ValidationFailedSimple: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. - case json(Components.Schemas.ValidationErrorSimple) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal`. + public struct PullRequestStackMinimal: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/base/ref`. + public var ref: Swift.String + /// Creates a new `BasePayload`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationErrorSimple { - get throws { - switch self { - case let .json(body): - return body - } - } + /// - Parameters: + /// - ref: + public init(ref: Swift.String) { + self.ref = ref + } + public enum CodingKeys: String, CodingKey { + case ref } } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailedSimple.Body + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/base`. + public var base: Components.Schemas.PullRequestStackMinimal.BasePayload + /// Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/open`. + public var open: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload`. + public struct PullRequestsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/state`. + public var state: Components.Schemas.PullRequestStackMinimal.PullRequestsPayloadPayload.StatePayload + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/draft`. + public var draft: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/head`. + public struct HeadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/head/ref`. + public var ref: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/head/sha`. + public var sha: Swift.String + /// Creates a new `HeadPayload`. + /// + /// - Parameters: + /// - ref: + /// - sha: + public init( + ref: Swift.String, + sha: Swift.String + ) { + self.ref = ref + self.sha = sha + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/PullRequestsPayload/head`. + public var head: Components.Schemas.PullRequestStackMinimal.PullRequestsPayloadPayload.HeadPayload + /// Creates a new `PullRequestsPayloadPayload`. + /// + /// - Parameters: + /// - number: + /// - state: + /// - draft: + /// - mergedAt: + /// - head: + public init( + number: Swift.Int, + state: Components.Schemas.PullRequestStackMinimal.PullRequestsPayloadPayload.StatePayload, + draft: Swift.Bool, + mergedAt: Foundation.Date? = nil, + head: Components.Schemas.PullRequestStackMinimal.PullRequestsPayloadPayload.HeadPayload + ) { + self.number = number + self.state = state + self.draft = draft + self.mergedAt = mergedAt + self.head = head + } + public enum CodingKeys: String, CodingKey { + case number + case state + case draft + case mergedAt = "merged_at" + case head + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/pull_requests`. + public typealias PullRequestsPayload = [Components.Schemas.PullRequestStackMinimal.PullRequestsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/pull-request-stack-minimal/pull_requests`. + public var pullRequests: Components.Schemas.PullRequestStackMinimal.PullRequestsPayload + /// Creates a new `PullRequestStackMinimal`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - nodeId: + /// - url: + /// - base: + /// - open: Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// - createdAt: + /// - pullRequests: + public init( + id: Swift.Int, + number: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + base: Components.Schemas.PullRequestStackMinimal.BasePayload, + open: Swift.Bool, + createdAt: Foundation.Date, + pullRequests: Components.Schemas.PullRequestStackMinimal.PullRequestsPayload + ) { + self.id = id + self.number = number + self.nodeId = nodeId + self.url = url + self.base = base + self.open = open + self.createdAt = createdAt + self.pullRequests = pullRequests + } + public enum CodingKeys: String, CodingKey { + case id + case number + case nodeId = "node_id" + case url + case base + case open + case createdAt = "created_at" + case pullRequests = "pull_requests" + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request`. + public struct PullRequestStackPullRequest: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value1`. + public var value1: Components.Schemas.PullRequestMinimal + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case closed = "closed" + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/state`. + public var state: Components.Schemas.PullRequestStackPullRequest.Value2Payload.StatePayload + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/merged_at`. + public var mergedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/draft`. + public var draft: Swift.Bool + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2/user`. + public var user: Components.Schemas.NullableSimpleUser? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - nodeId: + /// - title: + /// - state: + /// - mergedAt: + /// - draft: + /// - htmlUrl: + /// - user: + public init( + nodeId: Swift.String, + title: Swift.String, + state: Components.Schemas.PullRequestStackPullRequest.Value2Payload.StatePayload, + mergedAt: Foundation.Date? = nil, + draft: Swift.Bool, + htmlUrl: Swift.String, + user: Components.Schemas.NullableSimpleUser? = nil + ) { + self.nodeId = nodeId + self.title = title + self.state = state + self.mergedAt = mergedAt + self.draft = draft + self.htmlUrl = htmlUrl + self.user = user + } + public enum CodingKeys: String, CodingKey { + case nodeId = "node_id" + case title + case state + case mergedAt = "merged_at" + case draft + case htmlUrl = "html_url" + case user + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack-pull-request/value2`. + public var value2: Components.Schemas.PullRequestStackPullRequest.Value2Payload + /// Creates a new `PullRequestStackPullRequest`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.PullRequestMinimal, + value2: Components.Schemas.PullRequestStackPullRequest.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/parameters/since`. + public typealias Since = Foundation.Date + /// The unique identifier of the comment. + /// + /// - Remark: Generated from `#/components/parameters/comment-id`. + public typealias CommentId = Swift.Int64 + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/sort`. + @frozen public enum Sort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + } + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String + /// The number that identifies the pull request. + /// + /// - Remark: Generated from `#/components/parameters/pull-number`. + public typealias PullNumber = Swift.Int + /// The unique identifier of the review. + /// + /// - Remark: Generated from `#/components/parameters/review-id`. + public typealias ReviewId = Swift.Int + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body /// Creates a new `ValidationFailedSimple`. /// /// - Parameters: @@ -5502,6 +6113,10 @@ public enum Components { self.body = body } } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } public struct ServiceUnavailable: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/service_unavailable/content`. @frozen public enum Body: Sendable, Hashable { @@ -12132,4 +12747,1881 @@ public enum Operations { } } } + /// List pull request stacks + /// + /// Lists pull request stacks in a repository. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/get(pull-request-stacks/list)`. + public enum PullRequestStacksList { + public static let id: Swift.String = "pull-request-stacks/list" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/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}/stacks/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}/stacks/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.PullRequestStacksList.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/GET/query`. + public struct Query: Sendable, Hashable { + /// Filter to the stack containing this repository pull request number. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/GET/query/pull_request`. + public var pullRequest: Swift.Int? + /// 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}/stacks/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/GET/query/page`. + public var page: Components.Parameters.Page? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - pullRequest: Filter to the stack containing this repository pull request number. + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + pullRequest: Swift.Int? = nil, + perPage: Components.Parameters.PerPage? = nil, + page: Components.Parameters.Page? = nil + ) { + self.pullRequest = pullRequest + self.perPage = perPage + self.page = page + } + } + public var query: Operations.PullRequestStacksList.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/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.PullRequestStacksList.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.PullRequestStacksList.Input.Path, + query: Operations.PullRequestStacksList.Input.Query = .init(), + headers: Operations.PullRequestStacksList.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}/stacks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/GET/responses/200/content/application\/json`. + case json([Components.Schemas.PullRequestStackMinimal]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.PullRequestStackMinimal] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksList.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksList.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/get(pull-request-stacks/list)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.PullRequestStacksList.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.PullRequestStacksList.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}/stacks/get(pull-request-stacks/list)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/get(pull-request-stacks/list)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Create a pull request stack + /// + /// Creates a stack from an ordered list of pull request numbers. Provide the pull + /// request numbers from the bottom of the stack to the top. Each pull request's + /// base ref must match the previous pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/post(pull-request-stacks/create)`. + public enum PullRequestStacksCreate { + public static let id: Swift.String = "pull-request-stacks/create" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/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}/stacks/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}/stacks/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.PullRequestStacksCreate.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/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.PullRequestStacksCreate.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// An ordered list of pull request numbers forming the stack from bottom to top. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/requestBody/json/pull_requests`. + public var pullRequests: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - pullRequests: An ordered list of pull request numbers forming the stack from bottom to top. + public init(pullRequests: [Swift.Int]) { + self.pullRequests = pullRequests + } + public enum CodingKeys: String, CodingKey { + case pullRequests = "pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/requestBody/content/application\/json`. + case json(Operations.PullRequestStacksCreate.Input.Body.JsonPayload) + } + public var body: Operations.PullRequestStacksCreate.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.PullRequestStacksCreate.Input.Path, + headers: Operations.PullRequestStacksCreate.Input.Headers = .init(), + body: Operations.PullRequestStacksCreate.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}/stacks/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/url`. + public var url: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/base/ref`. + public var ref: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: + public init(ref: Swift.String) { + self.ref = ref + } + public enum CodingKeys: String, CodingKey { + case ref + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/base`. + public var base: Operations.PullRequestStacksCreate.Output.Created.Body.JsonPayload.BasePayload + /// Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/open`. + public var open: Swift.Bool + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/json/pull_requests`. + public var pullRequests: [Components.Schemas.PullRequestStackPullRequest] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - nodeId: + /// - url: + /// - base: + /// - open: Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// - createdAt: + /// - pullRequests: + public init( + id: Swift.Int, + number: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + base: Operations.PullRequestStacksCreate.Output.Created.Body.JsonPayload.BasePayload, + open: Swift.Bool, + createdAt: Foundation.Date, + pullRequests: [Components.Schemas.PullRequestStackPullRequest] + ) { + self.id = id + self.number = number + self.nodeId = nodeId + self.url = url + self.base = base + self.open = open + self.createdAt = createdAt + self.pullRequests = pullRequests + } + public enum CodingKeys: String, CodingKey { + case id + case number + case nodeId = "node_id" + case url + case base + case open + case createdAt = "created_at" + case pullRequests = "pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/201/content/application\/json`. + case json(Operations.PullRequestStacksCreate.Output.Created.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.PullRequestStacksCreate.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksCreate.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksCreate.Output.Created.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/post(pull-request-stacks/create)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.PullRequestStacksCreate.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.PullRequestStacksCreate.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/post(pull-request-stacks/create)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Validation Error + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/message`. + public var message: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value/Case3Payload`. + @frozen public enum Case3PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value/Case3Payload/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value/Case3Payload/case2`. + case case2(Swift.Int) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value/case3`. + public typealias Case3Payload = [Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload.Case3PayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value/case3`. + case case3(Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload.Case3Payload?) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/ErrorsPayload/value`. + public var value: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/json/errors`. + public var errors: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/POST/responses/422/content/application\/json`. + case json(Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksCreate.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation failed. Returned when the request references pull requests that + /// don't exist in the repository, or when the pull requests can't form a + /// valid stack. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/post(pull-request-stacks/create)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.PullRequestStacksCreate.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.PullRequestStacksCreate.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a pull request stack + /// + /// Gets a pull request stack by providing its stack number. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/stacks/{stack_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/get(pull-request-stacks/get)`. + public enum PullRequestStacksGet { + public static let id: Swift.String = "pull-request-stacks/get" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the pull request stack. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/path/stack_number`. + public var stackNumber: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - stackNumber: The number that identifies the pull request stack. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + stackNumber: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.stackNumber = stackNumber + } + } + public var path: Operations.PullRequestStacksGet.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.PullRequestStacksGet.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.PullRequestStacksGet.Input.Path, + headers: Operations.PullRequestStacksGet.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/url`. + public var url: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/base/ref`. + public var ref: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: + public init(ref: Swift.String) { + self.ref = ref + } + public enum CodingKeys: String, CodingKey { + case ref + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/base`. + public var base: Operations.PullRequestStacksGet.Output.Ok.Body.JsonPayload.BasePayload + /// Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/open`. + public var open: Swift.Bool + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/json/pull_requests`. + public var pullRequests: [Components.Schemas.PullRequestStackPullRequest] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - nodeId: + /// - url: + /// - base: + /// - open: Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// - createdAt: + /// - pullRequests: + public init( + id: Swift.Int, + number: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + base: Operations.PullRequestStacksGet.Output.Ok.Body.JsonPayload.BasePayload, + open: Swift.Bool, + createdAt: Foundation.Date, + pullRequests: [Components.Schemas.PullRequestStackPullRequest] + ) { + self.id = id + self.number = number + self.nodeId = nodeId + self.url = url + self.base = base + self.open = open + self.createdAt = createdAt + self.pullRequests = pullRequests + } + public enum CodingKeys: String, CodingKey { + case id + case number + case nodeId = "node_id" + case url + case base + case open + case createdAt = "created_at" + case pullRequests = "pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/GET/responses/200/content/application\/json`. + case json(Operations.PullRequestStacksGet.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.PullRequestStacksGet.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksGet.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksGet.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/get(pull-request-stacks/get)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.PullRequestStacksGet.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.PullRequestStacksGet.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}/stacks/{stack_number}/get(pull-request-stacks/get)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + 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 pull requests to a pull request stack + /// + /// Appends an ordered list of pull request numbers onto the top of an existing + /// stack. Provide only the pull requests you want to add, from the current top of + /// the stack upward. The first new pull request's base ref must match the current + /// top pull request's head ref. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/add`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/add/post(pull-request-stacks/add)`. + public enum PullRequestStacksAdd { + public static let id: Swift.String = "pull-request-stacks/add" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/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}/stacks/{stack_number}/add/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}/stacks/{stack_number}/add/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the pull request stack. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/path/stack_number`. + public var stackNumber: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - stackNumber: The number that identifies the pull request stack. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + stackNumber: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.stackNumber = stackNumber + } + } + public var path: Operations.PullRequestStacksAdd.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.PullRequestStacksAdd.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// An ordered list of pull request numbers to append to the stack, from the current top upward. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/requestBody/json/pull_requests`. + public var pullRequests: [Swift.Int] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - pullRequests: An ordered list of pull request numbers to append to the stack, from the current top upward. + public init(pullRequests: [Swift.Int]) { + self.pullRequests = pullRequests + } + public enum CodingKeys: String, CodingKey { + case pullRequests = "pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/requestBody/content/application\/json`. + case json(Operations.PullRequestStacksAdd.Input.Body.JsonPayload) + } + public var body: Operations.PullRequestStacksAdd.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.PullRequestStacksAdd.Input.Path, + headers: Operations.PullRequestStacksAdd.Input.Headers = .init(), + body: Operations.PullRequestStacksAdd.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}/stacks/{stack_number}/add/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/url`. + public var url: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/base/ref`. + public var ref: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: + public init(ref: Swift.String) { + self.ref = ref + } + public enum CodingKeys: String, CodingKey { + case ref + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/base`. + public var base: Operations.PullRequestStacksAdd.Output.Ok.Body.JsonPayload.BasePayload + /// Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/open`. + public var open: Swift.Bool + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/json/pull_requests`. + public var pullRequests: [Components.Schemas.PullRequestStackPullRequest] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - nodeId: + /// - url: + /// - base: + /// - open: Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// - createdAt: + /// - pullRequests: + public init( + id: Swift.Int, + number: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + base: Operations.PullRequestStacksAdd.Output.Ok.Body.JsonPayload.BasePayload, + open: Swift.Bool, + createdAt: Foundation.Date, + pullRequests: [Components.Schemas.PullRequestStackPullRequest] + ) { + self.id = id + self.number = number + self.nodeId = nodeId + self.url = url + self.base = base + self.open = open + self.createdAt = createdAt + self.pullRequests = pullRequests + } + public enum CodingKeys: String, CodingKey { + case id + case number + case nodeId = "node_id" + case url + case base + case open + case createdAt = "created_at" + case pullRequests = "pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/200/content/application\/json`. + case json(Operations.PullRequestStacksAdd.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.PullRequestStacksAdd.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksAdd.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksAdd.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/add/post(pull-request-stacks/add)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.PullRequestStacksAdd.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.PullRequestStacksAdd.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}/stacks/{stack_number}/add/post(pull-request-stacks/add)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/409/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksAdd.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksAdd.Output.Conflict.Body) { + self.body = body + } + } + /// Conflict. Returned when the stack is being modified by another request. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/add/post(pull-request-stacks/add)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.PullRequestStacksAdd.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.PullRequestStacksAdd.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Validation Error + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/message`. + public var message: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/resource`. + public var resource: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/field`. + public var field: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/code`. + public var code: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/index`. + public var index: Swift.Int? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value`. + @frozen public enum ValuePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value/case1`. + case case1(Swift.String?) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value/case2`. + case case2(Swift.Int?) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value/Case3Payload`. + @frozen public enum Case3PayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value/Case3Payload/case1`. + case case1(Swift.String) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value/Case3Payload/case2`. + case case2(Swift.Int) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value/case3`. + public typealias Case3Payload = [Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload.Case3PayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value/case3`. + case case3(Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload.Case3Payload?) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case2(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try encoder.encodeToSingleValueContainer(value) + case let .case2(value): + try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) + } + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/ErrorsPayload/value`. + public var value: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - resource: + /// - field: + /// - message: + /// - code: + /// - index: + /// - value: + public init( + resource: Swift.String? = nil, + field: Swift.String? = nil, + message: Swift.String? = nil, + code: Swift.String, + index: Swift.Int? = nil, + value: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.ValuePayload? = nil + ) { + self.resource = resource + self.field = field + self.message = message + self.code = code + self.index = index + self.value = value + } + public enum CodingKeys: String, CodingKey { + case resource + case field + case message + case code + case index + case value + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/json/errors`. + public var errors: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - errors: + public init( + message: Swift.String, + documentationUrl: Swift.String, + errors: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case errors + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/add/POST/responses/422/content/application\/json`. + case json(Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksAdd.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation failed. Returned when the request references pull requests that + /// don't exist in the repository, or when the pull requests can't be appended + /// to the stack. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/add/post(pull-request-stacks/add)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.PullRequestStacksAdd.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.PullRequestStacksAdd.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove pull requests from a pull request stack + /// + /// Removes the unmerged pull requests from a stack. Pull requests that cannot be + /// unstacked (for example, those that are queued for merge) are left in place. When pull requests remain in the stack, the updated + /// stack is returned with a `200`. When no pull requests remain, the stack is + /// dissolved and a `204` is returned. + /// + /// - Remark: HTTP `POST /repos/{owner}/{repo}/stacks/{stack_number}/unstack`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)`. + public enum PullRequestStacksUnstack { + public static let id: Swift.String = "pull-request-stacks/unstack" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/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}/stacks/{stack_number}/unstack/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}/stacks/{stack_number}/unstack/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies the pull request stack. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/path/stack_number`. + public var stackNumber: Swift.Int + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - stackNumber: The number that identifies the pull request stack. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + stackNumber: Swift.Int + ) { + self.owner = owner + self.repo = repo + self.stackNumber = stackNumber + } + } + public var path: Operations.PullRequestStacksUnstack.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/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.PullRequestStacksUnstack.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.PullRequestStacksUnstack.Input.Path, + headers: Operations.PullRequestStacksUnstack.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/id`. + public var id: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/number`. + public var number: Swift.Int + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/url`. + public var url: Swift.String + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/base/ref`. + public var ref: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: + public init(ref: Swift.String) { + self.ref = ref + } + public enum CodingKeys: String, CodingKey { + case ref + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/base`. + public var base: Operations.PullRequestStacksUnstack.Output.Ok.Body.JsonPayload.BasePayload + /// Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/open`. + public var open: Swift.Bool + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/created_at`. + public var createdAt: Foundation.Date + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/json/pull_requests`. + public var pullRequests: [Components.Schemas.PullRequestStackPullRequest] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - id: + /// - number: + /// - nodeId: + /// - url: + /// - base: + /// - open: Whether the stack has any open pull request. False when all pull requests are merged or closed. + /// - createdAt: + /// - pullRequests: + public init( + id: Swift.Int, + number: Swift.Int, + nodeId: Swift.String, + url: Swift.String, + base: Operations.PullRequestStacksUnstack.Output.Ok.Body.JsonPayload.BasePayload, + open: Swift.Bool, + createdAt: Foundation.Date, + pullRequests: [Components.Schemas.PullRequestStackPullRequest] + ) { + self.id = id + self.number = number + self.nodeId = nodeId + self.url = url + self.base = base + self.open = open + self.createdAt = createdAt + self.pullRequests = pullRequests + } + public enum CodingKeys: String, CodingKey { + case id + case number + case nodeId = "node_id" + case url + case base + case open + case createdAt = "created_at" + case pullRequests = "pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/200/content/application\/json`. + case json(Operations.PullRequestStacksUnstack.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.PullRequestStacksUnstack.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksUnstack.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksUnstack.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.PullRequestStacksUnstack.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.PullRequestStacksUnstack.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}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/409/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksUnstack.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksUnstack.Output.Conflict.Body) { + self.body = body + } + } + /// Conflict. Returned when the stack is being modified by another request. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.PullRequestStacksUnstack.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.PullRequestStacksUnstack.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/stacks/{stack_number}/unstack/POST/responses/422/content/application\/json`. + case json(Components.Schemas.ValidationError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PullRequestStacksUnstack.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PullRequestStacksUnstack.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation failed. Returned when the stack can't be unstacked because every + /// pull request in it is locked and cannot be removed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.PullRequestStacksUnstack.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.PullRequestStacksUnstack.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/stacks/{stack_number}/unstack/post(pull-request-stacks/unstack)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } } From 58eeaf153d9cef5f8f458a4deb07dab83f66f97c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:43:11 +0000 Subject: [PATCH 10/18] Commit via running: make Sources/repos --- Sources/repos/Client.swift | 10 ++ Sources/repos/Types.swift | 277 +++++++++++++++++++++++++++++++++++-- 2 files changed, 276 insertions(+), 11 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 5d0e1e749f..a971585178 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -15574,6 +15574,11 @@ public struct Client: APIProtocol { /// /// Users with push access to the repository can create a release. /// + /// > [!NOTE] + /// > If the commit identified by `target_commitish` (or, when `target_commitish` is omitted, the latest commit on the default branch) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases`. @@ -16287,6 +16292,11 @@ public struct Client: APIProtocol { /// /// Users with push access to the repository can edit a release. /// + /// > [!NOTE] + /// > If the resolved target commit (the new value of `target_commitish` if you are changing it, otherwise the existing target) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/releases/{release_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/patch(repos/update-release)`. public func reposUpdateRelease(_ input: Operations.ReposUpdateRelease.Input) async throws -> Operations.ReposUpdateRelease.Output { diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 6520ff6c7a..9cb657bb36 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -1677,6 +1677,11 @@ public protocol APIProtocol: Sendable { /// /// Users with push access to the repository can create a release. /// + /// > [!NOTE] + /// > If the commit identified by `target_commitish` (or, when `target_commitish` is omitted, the latest commit on the default branch) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases`. @@ -1746,6 +1751,11 @@ public protocol APIProtocol: Sendable { /// /// Users with push access to the repository can edit a release. /// + /// > [!NOTE] + /// > If the resolved target commit (the new value of `target_commitish` if you are changing it, otherwise the existing target) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/releases/{release_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/patch(repos/update-release)`. func reposUpdateRelease(_ input: Operations.ReposUpdateRelease.Input) async throws -> Operations.ReposUpdateRelease.Output @@ -5104,6 +5114,11 @@ extension APIProtocol { /// /// Users with push access to the repository can create a release. /// + /// > [!NOTE] + /// > If the commit identified by `target_commitish` (or, when `target_commitish` is omitted, the latest commit on the default branch) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases`. @@ -5243,6 +5258,11 @@ extension APIProtocol { /// /// Users with push access to the repository can edit a release. /// + /// > [!NOTE] + /// > If the resolved target commit (the new value of `target_commitish` if you are changing it, otherwise the existing target) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/releases/{release_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/patch(repos/update-release)`. public func reposUpdateRelease( @@ -10406,6 +10426,84 @@ public enum Components { case commitMessage = "commit_message" } } + /// The stack information associated with a pull request. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack`. + public struct PullRequestStack: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// The base ref of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/ref`. + public var ref: Swift.String + /// The base SHA of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/sha`. + public var sha: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: The base ref of the stack this pull request belongs to. + /// - sha: The base SHA of the stack this pull request belongs to. + public init( + ref: Swift.String, + sha: Swift.String + ) { + self.ref = ref + self.sha = sha + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public var base: Components.Schemas.PullRequestStack.BasePayload + /// The total number of pull requests in the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/size`. + public var size: Swift.Int? + /// The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/position`. + public var position: Swift.Int? + /// The ID of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/id`. + public var id: Swift.Int? + /// The number of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/number`. + public var number: Swift.Int? + /// Creates a new `PullRequestStack`. + /// + /// - Parameters: + /// - base: + /// - size: The total number of pull requests in the stack. + /// - position: The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// - id: The ID of the stack that this pull request belongs to. + /// - number: The number of the stack that this pull request belongs to. + public init( + base: Components.Schemas.PullRequestStack.BasePayload, + size: Swift.Int? = nil, + position: Swift.Int? = nil, + id: Swift.Int? = nil, + number: Swift.Int? = nil + ) { + self.base = base + self.size = size + self.position = position + self.id = id + self.number = number + } + public enum CodingKeys: String, CodingKey { + case base + case size + case position + case id + case number + } + } /// Pull Request Simple /// /// - Remark: Generated from `#/components/schemas/pull-request-simple`. @@ -10676,6 +10774,8 @@ public enum Components { public var authorAssociation: Components.Schemas.AuthorAssociation /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. public var autoMerge: Components.Schemas.AutoMerge? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/stack`. + public var stack: Components.Schemas.PullRequestStack? /// Indicates whether or not the pull request is a draft. /// /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. @@ -10718,6 +10818,7 @@ public enum Components { /// - _links: /// - authorAssociation: /// - autoMerge: + /// - stack: /// - draft: Indicates whether or not the pull request is a draft. public init( url: Swift.String, @@ -10755,6 +10856,7 @@ public enum Components { _links: Components.Schemas.PullRequestSimple._LinksPayload, authorAssociation: Components.Schemas.AuthorAssociation, autoMerge: Components.Schemas.AutoMerge? = nil, + stack: Components.Schemas.PullRequestStack? = nil, draft: Swift.Bool? = nil ) { self.url = url @@ -10792,6 +10894,7 @@ public enum Components { self._links = _links self.authorAssociation = authorAssociation self.autoMerge = autoMerge + self.stack = stack self.draft = draft } public enum CodingKeys: String, CodingKey { @@ -10830,6 +10933,7 @@ public enum Components { case _links case authorAssociation = "author_association" case autoMerge = "auto_merge" + case stack case draft } } @@ -13233,6 +13337,73 @@ public enum Components { case _type = "type" } } + /// An actor allowed to dismiss pull request reviews + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-actor`. + public struct RepositoryRuleParamsActor: Codable, Hashable, Sendable { + /// ID of the actor that can dismiss reviews. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-actor/id`. + public var id: Swift.Int + /// The type of the actor + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-actor/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "User" + case team = "Team" + case integrationInstallation = "IntegrationInstallation" + case repositoryRole = "RepositoryRole" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-actor/type`. + public var _type: Components.Schemas.RepositoryRuleParamsActor._TypePayload + /// Creates a new `RepositoryRuleParamsActor`. + /// + /// - Parameters: + /// - id: ID of the actor that can dismiss reviews. + /// - _type: The type of the actor + public init( + id: Swift.Int, + _type: Components.Schemas.RepositoryRuleParamsActor._TypePayload + ) { + self.id = id + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + } + } + /// Specify people, teams, or apps allowed to dismiss pull request reviews. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-dismissal-restriction`. + public struct RepositoryRuleParamsDismissalRestriction: Codable, Hashable, Sendable { + /// Specify people, teams, or apps allowed to dismiss pull request reviews. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-dismissal-restriction/allowed_actors`. + public var allowedActors: [Components.Schemas.RepositoryRuleParamsActor]? + /// Whether to restrict review dismissal to specific actors. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-params-dismissal-restriction/enabled`. + public var enabled: Swift.Bool + /// Creates a new `RepositoryRuleParamsDismissalRestriction`. + /// + /// - Parameters: + /// - allowedActors: Specify people, teams, or apps allowed to dismiss pull request reviews. + /// - enabled: Whether to restrict review dismissal to specific actors. + public init( + allowedActors: [Components.Schemas.RepositoryRuleParamsActor]? = nil, + enabled: Swift.Bool + ) { + self.allowedActors = allowedActors + self.enabled = enabled + } + public enum CodingKeys: String, CodingKey { + case allowedActors = "allowed_actors" + case enabled + } + } /// A required reviewing team /// /// - Remark: Generated from `#/components/schemas/repository-rule-params-reviewer`. @@ -13333,6 +13504,8 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/dismiss_stale_reviews_on_push`. public var dismissStaleReviewsOnPush: Swift.Bool + /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/dismissal_restriction`. + public var dismissalRestriction: Components.Schemas.RepositoryRuleParamsDismissalRestriction? /// Require an approving review in pull requests that modify files that have a designated code owner. /// /// - Remark: Generated from `#/components/schemas/repository-rule-pull-request/parameters/require_code_owner_review`. @@ -13361,6 +13534,7 @@ public enum Components { /// - Parameters: /// - allowedMergeMethods: Array of allowed merge methods. Allowed values include `merge`, `squash`, and `rebase`. At least one option must be enabled. /// - dismissStaleReviewsOnPush: New, reviewable commits pushed will dismiss previous pull request review approvals. + /// - dismissalRestriction: /// - requireCodeOwnerReview: Require an approving review in pull requests that modify files that have a designated code owner. /// - requireLastPushApproval: Whether the most recent reviewable push must be approved by someone other than the person who pushed it. /// - requiredApprovingReviewCount: The number of approving reviews that are required before a pull request can be merged. @@ -13369,6 +13543,7 @@ public enum Components { public init( allowedMergeMethods: Components.Schemas.RepositoryRulePullRequest.ParametersPayload.AllowedMergeMethodsPayload? = nil, dismissStaleReviewsOnPush: Swift.Bool, + dismissalRestriction: Components.Schemas.RepositoryRuleParamsDismissalRestriction? = nil, requireCodeOwnerReview: Swift.Bool, requireLastPushApproval: Swift.Bool, requiredApprovingReviewCount: Swift.Int, @@ -13377,6 +13552,7 @@ public enum Components { ) { self.allowedMergeMethods = allowedMergeMethods self.dismissStaleReviewsOnPush = dismissStaleReviewsOnPush + self.dismissalRestriction = dismissalRestriction self.requireCodeOwnerReview = requireCodeOwnerReview self.requireLastPushApproval = requireLastPushApproval self.requiredApprovingReviewCount = requiredApprovingReviewCount @@ -13386,6 +13562,7 @@ public enum Components { public enum CodingKeys: String, CodingKey { case allowedMergeMethods = "allowed_merge_methods" case dismissStaleReviewsOnPush = "dismiss_stale_reviews_on_push" + case dismissalRestriction = "dismissal_restriction" case requireCodeOwnerReview = "require_code_owner_review" case requireLastPushApproval = "require_last_push_approval" case requiredApprovingReviewCount = "required_approving_review_count" @@ -14190,6 +14367,27 @@ public enum Components { case parameters } } + /// Enforce any added or changed dependencies to comply with the organization's license policy. + /// + /// - Remark: Generated from `#/components/schemas/repository-rule-license-compliance-scanning`. + public struct RepositoryRuleLicenseComplianceScanning: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-license-compliance-scanning/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case licenseComplianceScanning = "license_compliance_scanning" + } + /// - Remark: Generated from `#/components/schemas/repository-rule-license-compliance-scanning/type`. + public var _type: Components.Schemas.RepositoryRuleLicenseComplianceScanning._TypePayload + /// Creates a new `RepositoryRuleLicenseComplianceScanning`. + /// + /// - Parameters: + /// - _type: + public init(_type: Components.Schemas.RepositoryRuleLicenseComplianceScanning._TypePayload) { + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + } + } /// Prevent commits that include changes in specified file and folder paths from being pushed to the commit graph. This includes absolute paths that contain file names. /// /// - Remark: Generated from `#/components/schemas/repository-rule-file-path-restriction`. @@ -14415,12 +14613,14 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/repository-rule/case18`. case RepositoryRuleCopilotCodeReview(Components.Schemas.RepositoryRuleCopilotCodeReview) /// - Remark: Generated from `#/components/schemas/repository-rule/case19`. - case RepositoryRuleFilePathRestriction(Components.Schemas.RepositoryRuleFilePathRestriction) + case RepositoryRuleLicenseComplianceScanning(Components.Schemas.RepositoryRuleLicenseComplianceScanning) /// - Remark: Generated from `#/components/schemas/repository-rule/case20`. - case RepositoryRuleMaxFilePathLength(Components.Schemas.RepositoryRuleMaxFilePathLength) + case RepositoryRuleFilePathRestriction(Components.Schemas.RepositoryRuleFilePathRestriction) /// - Remark: Generated from `#/components/schemas/repository-rule/case21`. - case RepositoryRuleFileExtensionRestriction(Components.Schemas.RepositoryRuleFileExtensionRestriction) + case RepositoryRuleMaxFilePathLength(Components.Schemas.RepositoryRuleMaxFilePathLength) /// - Remark: Generated from `#/components/schemas/repository-rule/case22`. + case RepositoryRuleFileExtensionRestriction(Components.Schemas.RepositoryRuleFileExtensionRestriction) + /// - Remark: Generated from `#/components/schemas/repository-rule/case23`. case RepositoryRuleMaxFileSize(Components.Schemas.RepositoryRuleMaxFileSize) public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] @@ -14532,6 +14732,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .RepositoryRuleLicenseComplianceScanning(try .init(from: decoder)) + return + } catch { + errors.append(error) + } do { self = .RepositoryRuleFilePathRestriction(try .init(from: decoder)) return @@ -14600,6 +14806,8 @@ public enum Components { try value.encode(to: encoder) case let .RepositoryRuleCopilotCodeReview(value): try value.encode(to: encoder) + case let .RepositoryRuleLicenseComplianceScanning(value): + try value.encode(to: encoder) case let .RepositoryRuleFilePathRestriction(value): try value.encode(to: encoder) case let .RepositoryRuleMaxFilePathLength(value): @@ -22857,7 +23065,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case19`. public struct Case19Payload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case19/value1`. - public var value1: Components.Schemas.RepositoryRuleFilePathRestriction + public var value1: Components.Schemas.RepositoryRuleLicenseComplianceScanning /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case19/value2`. public var value2: Components.Schemas.RepositoryRuleRulesetInfo /// Creates a new `Case19Payload`. @@ -22866,7 +23074,7 @@ public enum Components { /// - value1: /// - value2: public init( - value1: Components.Schemas.RepositoryRuleFilePathRestriction, + value1: Components.Schemas.RepositoryRuleLicenseComplianceScanning, value2: Components.Schemas.RepositoryRuleRulesetInfo ) { self.value1 = value1 @@ -22886,7 +23094,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case20`. public struct Case20Payload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case20/value1`. - public var value1: Components.Schemas.RepositoryRuleMaxFilePathLength + public var value1: Components.Schemas.RepositoryRuleFilePathRestriction /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case20/value2`. public var value2: Components.Schemas.RepositoryRuleRulesetInfo /// Creates a new `Case20Payload`. @@ -22895,7 +23103,7 @@ public enum Components { /// - value1: /// - value2: public init( - value1: Components.Schemas.RepositoryRuleMaxFilePathLength, + value1: Components.Schemas.RepositoryRuleFilePathRestriction, value2: Components.Schemas.RepositoryRuleRulesetInfo ) { self.value1 = value1 @@ -22915,7 +23123,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21`. public struct Case21Payload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21/value1`. - public var value1: Components.Schemas.RepositoryRuleFileExtensionRestriction + public var value1: Components.Schemas.RepositoryRuleMaxFilePathLength /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case21/value2`. public var value2: Components.Schemas.RepositoryRuleRulesetInfo /// Creates a new `Case21Payload`. @@ -22924,7 +23132,7 @@ public enum Components { /// - value1: /// - value2: public init( - value1: Components.Schemas.RepositoryRuleFileExtensionRestriction, + value1: Components.Schemas.RepositoryRuleMaxFilePathLength, value2: Components.Schemas.RepositoryRuleRulesetInfo ) { self.value1 = value1 @@ -22944,7 +23152,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. public struct Case22Payload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value1`. - public var value1: Components.Schemas.RepositoryRuleMaxFileSize + public var value1: Components.Schemas.RepositoryRuleFileExtensionRestriction /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22/value2`. public var value2: Components.Schemas.RepositoryRuleRulesetInfo /// Creates a new `Case22Payload`. @@ -22953,7 +23161,7 @@ public enum Components { /// - value1: /// - value2: public init( - value1: Components.Schemas.RepositoryRuleMaxFileSize, + value1: Components.Schemas.RepositoryRuleFileExtensionRestriction, value2: Components.Schemas.RepositoryRuleRulesetInfo ) { self.value1 = value1 @@ -22970,6 +23178,35 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case22`. case case22(Components.Schemas.RepositoryRuleDetailed.Case22Payload) + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case23`. + public struct Case23Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case23/value1`. + public var value1: Components.Schemas.RepositoryRuleMaxFileSize + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case23/value2`. + public var value2: Components.Schemas.RepositoryRuleRulesetInfo + /// Creates a new `Case23Payload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.RepositoryRuleMaxFileSize, + value2: Components.Schemas.RepositoryRuleRulesetInfo + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/repository-rule-detailed/case23`. + case case23(Components.Schemas.RepositoryRuleDetailed.Case23Payload) public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] do { @@ -23104,6 +23341,12 @@ public enum Components { } catch { errors.append(error) } + do { + self = .case23(try .init(from: decoder)) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -23156,6 +23399,8 @@ public enum Components { try value.encode(to: encoder) case let .case22(value): try value.encode(to: encoder) + case let .case23(value): + try value.encode(to: encoder) } } } @@ -57266,6 +57511,11 @@ public enum Operations { /// /// Users with push access to the repository can create a release. /// + /// > [!NOTE] + /// > If the commit identified by `target_commitish` (or, when `target_commitish` is omitted, the latest commit on the default branch) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." /// /// - Remark: HTTP `POST /repos/{owner}/{repo}/releases`. @@ -58894,6 +59144,11 @@ public enum Operations { /// /// Users with push access to the repository can edit a release. /// + /// > [!NOTE] + /// > If the resolved target commit (the new value of `target_commitish` if you are changing it, otherwise the existing target) adds or modifies any file under `.github/workflows/` relative to the repository's default branch, the authenticating token must be authorized to modify workflows. Otherwise, this endpoint returns `404 Not Found`; some authentication paths surface `403 Resource not accessible by integration` instead. + /// + /// OAuth app tokens and personal access tokens (classic) need the `workflow` scope when the resolved target commit modifies workflow files. Fine-grained access tokens and GitHub App installation tokens also need the "Workflows" repository permission (write). The `GITHUB_TOKEN` available to GitHub Actions cannot be authorized for this; for more information, see "[Automatic token authentication](https://docs.github.com/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)". + /// /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/releases/{release_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/patch(repos/update-release)`. public enum ReposUpdateRelease { From 38a9a22d62d464c4298306c338b78b049c86ba26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:43:57 +0000 Subject: [PATCH 11/18] Commit via running: make Sources/secret-scanning --- Sources/secret-scanning/Client.swift | 1862 +++++++-- Sources/secret-scanning/Types.swift | 5240 +++++++++++++++++++++----- 2 files changed, 5937 insertions(+), 1165 deletions(-) diff --git a/Sources/secret-scanning/Client.swift b/Sources/secret-scanning/Client.swift index 94710ce3c0..b4e7df0e47 100644 --- a/Sources/secret-scanning/Client.swift +++ b/Sources/secret-scanning/Client.swift @@ -190,6 +190,20 @@ public struct Client: APIProtocol { name: "is_bypassed", value: input.query.isBypassed ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "included_metadata", + value: input.query.includedMetadata + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "owner_email_hash", + value: input.query.ownerEmailHash + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -284,21 +298,21 @@ public struct Client: APIProtocol { } ) } - /// List organization pattern configurations + /// List organization custom patterns /// - /// Lists the secret scanning pattern configurations for an organization. + /// Lists secret scanning custom patterns for an organization. /// /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. - public func secretScanningListOrgPatternConfigs(_ input: Operations.SecretScanningListOrgPatternConfigs.Input) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output { + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/get(secret-scanning/list-org-custom-patterns)`. + public func secretScanningListOrgCustomPatterns(_ input: Operations.SecretScanningListOrgCustomPatterns.Input) async throws -> Operations.SecretScanningListOrgCustomPatterns.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningListOrgPatternConfigs.id, + forOperation: Operations.SecretScanningListOrgCustomPatterns.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/secret-scanning/pattern-configurations", + template: "/orgs/{}/secret-scanning/custom-patterns", parameters: [ input.path.org ] @@ -308,6 +322,48 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "push_protection", + value: input.query.pushProtection + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -317,8 +373,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.SecretScanningListOrgCustomPatterns.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.SecretScanningListOrgPatternConfigs.Output.Ok.Body + let body: Operations.SecretScanningListOrgCustomPatterns.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -328,7 +389,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.SecretScanningPatternConfiguration.self, + [Components.Schemas.SecretScanningCustomPattern].self, from: responseBody, transforming: { value in .json(value) @@ -337,7 +398,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -394,28 +458,28 @@ public struct Client: APIProtocol { } ) } - /// Update organization pattern configurations + /// Bulk create organization custom patterns /// - /// Updates the secret scanning pattern configurations for an organization. + /// Bulk creates secret scanning custom patterns for an organization. /// /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. /// - /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. - public func secretScanningUpdateOrgPatternConfigs(_ input: Operations.SecretScanningUpdateOrgPatternConfigs.Input) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output { + /// - Remark: HTTP `POST /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)`. + public func secretScanningBulkCreateOrgCustomPatterns(_ input: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input) async throws -> Operations.SecretScanningBulkCreateOrgCustomPatterns.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningUpdateOrgPatternConfigs.id, + forOperation: Operations.SecretScanningBulkCreateOrgCustomPatterns.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/secret-scanning/pattern-configurations", + template: "/orgs/{}/secret-scanning/custom-patterns", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -435,9 +499,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body + let body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -447,7 +511,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload.self, + Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -456,7 +520,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.BadRequest.Body @@ -532,9 +596,117 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 409: + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Conflict.Body + let body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Bulk delete organization custom patterns + /// + /// Bulk deletes secret scanning custom patterns for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)`. + public func secretScanningBulkDeleteOrgCustomPatterns(_ input: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input) async throws -> Operations.SecretScanningBulkDeleteOrgCustomPatterns.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningBulkDeleteOrgCustomPatterns.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/secret-scanning/custom-patterns", + parameters: [ + input.path.org + ] + ) + 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 204: + return .noContent(.init()) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -553,10 +725,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .conflict(.init(body: body)) - case 422: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -566,7 +738,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -575,7 +747,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) + case 412: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.PreconditionFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .preconditionFailed(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -588,81 +782,1106 @@ public struct Client: APIProtocol { } ) } - /// List secret scanning alerts for a repository - /// - /// Lists secret scanning alerts for an eligible repository, from newest to oldest. + /// Update an organization custom pattern /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Updates a secret scanning custom pattern for an organization. /// - /// 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. + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)`. - public func secretScanningListAlertsForRepo(_ input: Operations.SecretScanningListAlertsForRepo.Input) async throws -> Operations.SecretScanningListAlertsForRepo.Output { + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)`. + public func secretScanningUpdateOrgCustomPattern(_ input: Operations.SecretScanningUpdateOrgCustomPattern.Input) async throws -> Operations.SecretScanningUpdateOrgCustomPattern.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningListAlertsForRepo.id, + forOperation: Operations.SecretScanningUpdateOrgCustomPattern.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/secret-scanning/alerts", + template: "/orgs/{}/secret-scanning/custom-patterns/{}", parameters: [ - input.path.owner, - input.path.repo + input.path.org, + input.path.patternId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .patch ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "state", - value: input.query.state - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "secret_type", - value: input.query.secretType - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "exclude_secret_types", - value: input.query.excludeSecretTypes - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "exclude_providers", - value: input.query.excludeProviders + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept ) - try converter.setQueryItemAsURI( + 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.SecretScanningUpdateOrgCustomPattern.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.SecretScanningCustomPattern.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 412: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.PreconditionFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .preconditionFailed(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public func secretScanningListOrgPatternConfigs(_ input: Operations.SecretScanningListOrgPatternConfigs.Input) async throws -> Operations.SecretScanningListOrgPatternConfigs.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningListOrgPatternConfigs.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/secret-scanning/pattern-configurations", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SecretScanningListOrgPatternConfigs.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.SecretScanningPatternConfiguration.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public func secretScanningUpdateOrgPatternConfigs(_ input: Operations.SecretScanningUpdateOrgPatternConfigs.Input) async throws -> Operations.SecretScanningUpdateOrgPatternConfigs.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningUpdateOrgPatternConfigs.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/secret-scanning/pattern-configurations", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List secret scanning alerts for a repository + /// + /// Lists secret scanning alerts for an eligible repository, from newest to oldest. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)`. + public func secretScanningListAlertsForRepo(_ input: Operations.SecretScanningListAlertsForRepo.Input) async throws -> Operations.SecretScanningListAlertsForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningListAlertsForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/secret-scanning/alerts", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "secret_type", + value: input.query.secretType + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "exclude_secret_types", + value: input.query.excludeSecretTypes + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "exclude_providers", + value: input.query.excludeProviders + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "providers", + value: input.query.providers + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "resolution", + value: input.query.resolution + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "assignee", + value: input.query.assignee + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "after", + value: input.query.after + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "validity", + value: input.query.validity + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_publicly_leaked", + value: input.query.isPubliclyLeaked + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_multi_repo", + value: input.query.isMultiRepo + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "hide_secret", + value: input.query.hideSecret + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_bypassed", + value: input.query.isBypassed + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "included_metadata", + value: input.query.includedMetadata + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "owner_email_hash", + value: input.query.ownerEmailHash + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SecretScanningListAlertsForRepo.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.SecretScanningAlert].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + return .notFound(.init()) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a secret scanning alert + /// + /// Gets a single secret scanning alert detected in an eligible repository. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)`. + public func secretScanningGetAlert(_ input: Operations.SecretScanningGetAlert.Input) async throws -> Operations.SecretScanningGetAlert.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningGetAlert.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/secret-scanning/alerts/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.alertNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "providers", - value: input.query.providers + name: "hide_secret", + value: input.query.hideSecret + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SecretScanningGetAlert.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.SecretScanningAlertWithMetadata.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 304: + return .notModified(.init()) + case 404: + return .notFound(.init()) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update a secret scanning alert + /// + /// Updates the status of a secret scanning alert in an eligible repository. + /// + /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)`. + public func secretScanningUpdateAlert(_ input: Operations.SecretScanningUpdateAlert.Input) async throws -> Operations.SecretScanningUpdateAlert.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningUpdateAlert.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/secret-scanning/alerts/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.alertNumber + ] + ) + 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.SecretScanningUpdateAlert.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.SecretScanningAlertWithMetadata.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + return .badRequest(.init()) + case 403: + return .forbidden(.init()) + case 404: + return .notFound(.init()) + case 422: + return .unprocessableContent(.init()) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List locations for a secret scanning alert + /// + /// Lists all locations for a given secret scanning alert for an eligible repository. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)`. + public func secretScanningListLocationsForAlert(_ input: Operations.SecretScanningListLocationsForAlert.Input) async throws -> Operations.SecretScanningListLocationsForAlert.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningListLocationsForAlert.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/secret-scanning/alerts/{}/locations", + parameters: [ + input.path.owner, + input.path.repo, + input.path.alertNumber + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let headers: Operations.SecretScanningListLocationsForAlert.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.SecretScanningListLocationsForAlert.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.SecretScanningLocation].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: + return .notFound(.init()) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repository custom patterns + /// + /// Lists secret scanning custom patterns 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/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/get(secret-scanning/list-repo-custom-patterns)`. + public func secretScanningListRepoCustomPatterns(_ input: Operations.SecretScanningListRepoCustomPatterns.Input) async throws -> Operations.SecretScanningListRepoCustomPatterns.Output { + try await client.send( + input: input, + forOperation: Operations.SecretScanningListRepoCustomPatterns.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/secret-scanning/custom-patterns", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get ) + suppressMutabilityWarning(&request) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "resolution", - value: input.query.resolution + name: "state", + value: input.query.state ) try converter.setQueryItemAsURI( in: &request, style: .form, explode: true, - name: "assignee", - value: input.query.assignee + name: "push_protection", + value: input.query.pushProtection ) try converter.setQueryItemAsURI( in: &request, @@ -692,55 +1911,6 @@ public struct Client: APIProtocol { name: "per_page", value: input.query.perPage ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "before", - value: input.query.before - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "after", - value: input.query.after - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "validity", - value: input.query.validity - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "is_publicly_leaked", - value: input.query.isPubliclyLeaked - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "is_multi_repo", - value: input.query.isMultiRepo - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "hide_secret", - value: input.query.hideSecret - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "is_bypassed", - value: input.query.isBypassed - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -750,8 +1920,13 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.SecretScanningListRepoCustomPatterns.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.SecretScanningListAlertsForRepo.Output.Ok.Body + let body: Operations.SecretScanningListRepoCustomPatterns.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -761,7 +1936,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SecretScanningAlert].self, + [Components.Schemas.SecretScanningCustomPattern].self, from: responseBody, transforming: { value in .json(value) @@ -770,12 +1945,35 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) case 404: - return .notFound(.init()) - case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -785,7 +1983,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -794,7 +1992,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -807,52 +2005,126 @@ public struct Client: APIProtocol { } ) } - /// Get a secret scanning alert + /// Bulk create repository custom patterns /// - /// Gets a single secret scanning alert detected in an eligible repository. - /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Bulk creates secret scanning custom patterns 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/alerts/{alert_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)`. - public func secretScanningGetAlert(_ input: Operations.SecretScanningGetAlert.Input) async throws -> Operations.SecretScanningGetAlert.Output { + /// - Remark: HTTP `POST /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)`. + public func secretScanningBulkCreateRepoCustomPatterns(_ input: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input) async throws -> Operations.SecretScanningBulkCreateRepoCustomPatterns.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningGetAlert.id, + forOperation: Operations.SecretScanningBulkCreateRepoCustomPatterns.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/secret-scanning/alerts/{}", + template: "/repos/{}/{}/secret-scanning/custom-patterns", parameters: [ input.path.owner, - input.path.repo, - input.path.alertNumber + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "hide_secret", - value: input.query.hideSecret - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.Created.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SecretScanningGetAlert.Output.Ok.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -862,7 +2134,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.SecretScanningAlert.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -871,14 +2143,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 304: - return .notModified(.init()) - case 404: - return .notFound(.init()) - case 503: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -888,7 +2156,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -897,7 +2165,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -910,34 +2178,29 @@ public struct Client: APIProtocol { } ) } - /// Update a secret scanning alert - /// - /// Updates the status of a secret scanning alert in an eligible repository. - /// - /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// Bulk delete repository custom patterns /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Bulk deletes secret scanning custom patterns 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 `PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)`. - public func secretScanningUpdateAlert(_ input: Operations.SecretScanningUpdateAlert.Input) async throws -> Operations.SecretScanningUpdateAlert.Output { + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)`. + public func secretScanningBulkDeleteRepoCustomPatterns(_ input: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input) async throws -> Operations.SecretScanningBulkDeleteRepoCustomPatterns.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningUpdateAlert.id, + forOperation: Operations.SecretScanningBulkDeleteRepoCustomPatterns.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/secret-scanning/alerts/{}", + template: "/repos/{}/{}/secret-scanning/custom-patterns", parameters: [ input.path.owner, - input.path.repo, - input.path.alertNumber + input.path.repo ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -957,39 +2220,64 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 204: + return .noContent(.init()) + case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SecretScanningUpdateAlert.Output.Ok.Body + let body: Components.Responses.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/json", + "application/scim+json" ] ) switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.SecretScanningAlert.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) } ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) - case 400: - return .badRequest(.init()) + return .badRequest(.init(body: body)) case 403: - return .forbidden(.init()) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) case 404: - return .notFound(.init()) - case 422: - return .unprocessableContent(.init()) - case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -999,7 +2287,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1008,7 +2296,29 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .notFound(.init(body: body)) + case 412: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.PreconditionFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .preconditionFailed(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1021,64 +2331,52 @@ public struct Client: APIProtocol { } ) } - /// List locations for a secret scanning alert - /// - /// Lists all locations for a given secret scanning alert for an eligible repository. + /// Update a repository custom pattern /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Updates a secret scanning custom pattern 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/alerts/{alert_number}/locations`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)`. - public func secretScanningListLocationsForAlert(_ input: Operations.SecretScanningListLocationsForAlert.Input) async throws -> Operations.SecretScanningListLocationsForAlert.Output { + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)`. + public func secretScanningUpdateRepoCustomPattern(_ input: Operations.SecretScanningUpdateRepoCustomPattern.Input) async throws -> Operations.SecretScanningUpdateRepoCustomPattern.Output { try await client.send( input: input, - forOperation: Operations.SecretScanningListLocationsForAlert.id, + forOperation: Operations.SecretScanningUpdateRepoCustomPattern.id, serializer: { input in let path = try converter.renderedPath( - template: "/repos/{}/{}/secret-scanning/alerts/{}/locations", + template: "/repos/{}/{}/secret-scanning/custom-patterns/{}", parameters: [ input.path.owner, input.path.repo, - input.path.alertNumber + input.path.patternId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .patch ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + 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.SecretScanningListLocationsForAlert.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.SecretScanningListLocationsForAlert.Output.Ok.Body + let body: Operations.SecretScanningUpdateRepoCustomPattern.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1088,7 +2386,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SecretScanningLocation].self, + Components.Schemas.SecretScanningCustomPattern.self, from: responseBody, transforming: { value in .json(value) @@ -1097,15 +2395,63 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json", + "application/scim+json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + case "application/scim+json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ScimError.self, + from: responseBody, + transforming: { value in + .applicationScimJson(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) case 404: - return .notFound(.init()) - case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ServiceUnavailable.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1115,7 +2461,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Responses.ServiceUnavailable.Body.JsonPayload.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -1124,7 +2470,51 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .serviceUnavailable(.init(body: body)) + return .notFound(.init(body: body)) + case 412: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.PreconditionFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .preconditionFailed(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index 4dbb288dea..93fca289b5 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -22,6 +22,42 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/alerts`. /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-org)`. func secretScanningListAlertsForOrg(_ input: Operations.SecretScanningListAlertsForOrg.Input) async throws -> Operations.SecretScanningListAlertsForOrg.Output + /// List organization custom patterns + /// + /// Lists secret scanning custom patterns for an organization. + /// + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/get(secret-scanning/list-org-custom-patterns)`. + func secretScanningListOrgCustomPatterns(_ input: Operations.SecretScanningListOrgCustomPatterns.Input) async throws -> Operations.SecretScanningListOrgCustomPatterns.Output + /// Bulk create organization custom patterns + /// + /// Bulk creates secret scanning custom patterns for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)`. + func secretScanningBulkCreateOrgCustomPatterns(_ input: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input) async throws -> Operations.SecretScanningBulkCreateOrgCustomPatterns.Output + /// Bulk delete organization custom patterns + /// + /// Bulk deletes secret scanning custom patterns for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)`. + func secretScanningBulkDeleteOrgCustomPatterns(_ input: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input) async throws -> Operations.SecretScanningBulkDeleteOrgCustomPatterns.Output + /// Update an organization custom pattern + /// + /// Updates a secret scanning custom pattern for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)`. + func secretScanningUpdateOrgCustomPattern(_ input: Operations.SecretScanningUpdateOrgCustomPattern.Input) async throws -> Operations.SecretScanningUpdateOrgCustomPattern.Output /// List organization pattern configurations /// /// Lists the secret scanning pattern configurations for an organization. @@ -86,6 +122,42 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)`. func secretScanningListLocationsForAlert(_ input: Operations.SecretScanningListLocationsForAlert.Input) async throws -> Operations.SecretScanningListLocationsForAlert.Output + /// List repository custom patterns + /// + /// Lists secret scanning custom patterns 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/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/get(secret-scanning/list-repo-custom-patterns)`. + func secretScanningListRepoCustomPatterns(_ input: Operations.SecretScanningListRepoCustomPatterns.Input) async throws -> Operations.SecretScanningListRepoCustomPatterns.Output + /// Bulk create repository custom patterns + /// + /// Bulk creates secret scanning custom patterns 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 `POST /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)`. + func secretScanningBulkCreateRepoCustomPatterns(_ input: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input) async throws -> Operations.SecretScanningBulkCreateRepoCustomPatterns.Output + /// Bulk delete repository custom patterns + /// + /// Bulk deletes secret scanning custom patterns 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 `DELETE /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)`. + func secretScanningBulkDeleteRepoCustomPatterns(_ input: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input) async throws -> Operations.SecretScanningBulkDeleteRepoCustomPatterns.Output + /// Update a repository custom pattern + /// + /// Updates a secret scanning custom pattern 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 `PATCH /repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)`. + func secretScanningUpdateRepoCustomPattern(_ input: Operations.SecretScanningUpdateRepoCustomPattern.Input) async throws -> Operations.SecretScanningUpdateRepoCustomPattern.Output /// Create a push protection bypass /// /// Creates a bypass for a previously push protected secret. @@ -134,6 +206,82 @@ extension APIProtocol { headers: headers )) } + /// List organization custom patterns + /// + /// Lists secret scanning custom patterns for an organization. + /// + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/get(secret-scanning/list-org-custom-patterns)`. + public func secretScanningListOrgCustomPatterns( + path: Operations.SecretScanningListOrgCustomPatterns.Input.Path, + query: Operations.SecretScanningListOrgCustomPatterns.Input.Query = .init(), + headers: Operations.SecretScanningListOrgCustomPatterns.Input.Headers = .init() + ) async throws -> Operations.SecretScanningListOrgCustomPatterns.Output { + try await secretScanningListOrgCustomPatterns(Operations.SecretScanningListOrgCustomPatterns.Input( + path: path, + query: query, + headers: headers + )) + } + /// Bulk create organization custom patterns + /// + /// Bulk creates secret scanning custom patterns for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)`. + public func secretScanningBulkCreateOrgCustomPatterns( + path: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Body + ) async throws -> Operations.SecretScanningBulkCreateOrgCustomPatterns.Output { + try await secretScanningBulkCreateOrgCustomPatterns(Operations.SecretScanningBulkCreateOrgCustomPatterns.Input( + path: path, + headers: headers, + body: body + )) + } + /// Bulk delete organization custom patterns + /// + /// Bulk deletes secret scanning custom patterns for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)`. + public func secretScanningBulkDeleteOrgCustomPatterns( + path: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Body + ) async throws -> Operations.SecretScanningBulkDeleteOrgCustomPatterns.Output { + try await secretScanningBulkDeleteOrgCustomPatterns(Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input( + path: path, + headers: headers, + body: body + )) + } + /// Update an organization custom pattern + /// + /// Updates a secret scanning custom pattern for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)`. + public func secretScanningUpdateOrgCustomPattern( + path: Operations.SecretScanningUpdateOrgCustomPattern.Input.Path, + headers: Operations.SecretScanningUpdateOrgCustomPattern.Input.Headers = .init(), + body: Operations.SecretScanningUpdateOrgCustomPattern.Input.Body + ) async throws -> Operations.SecretScanningUpdateOrgCustomPattern.Output { + try await secretScanningUpdateOrgCustomPattern(Operations.SecretScanningUpdateOrgCustomPattern.Input( + path: path, + headers: headers, + body: body + )) + } /// List organization pattern configurations /// /// Lists the secret scanning pattern configurations for an organization. @@ -256,6 +404,82 @@ extension APIProtocol { headers: headers )) } + /// List repository custom patterns + /// + /// Lists secret scanning custom patterns 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/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/get(secret-scanning/list-repo-custom-patterns)`. + public func secretScanningListRepoCustomPatterns( + path: Operations.SecretScanningListRepoCustomPatterns.Input.Path, + query: Operations.SecretScanningListRepoCustomPatterns.Input.Query = .init(), + headers: Operations.SecretScanningListRepoCustomPatterns.Input.Headers = .init() + ) async throws -> Operations.SecretScanningListRepoCustomPatterns.Output { + try await secretScanningListRepoCustomPatterns(Operations.SecretScanningListRepoCustomPatterns.Input( + path: path, + query: query, + headers: headers + )) + } + /// Bulk create repository custom patterns + /// + /// Bulk creates secret scanning custom patterns 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 `POST /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)`. + public func secretScanningBulkCreateRepoCustomPatterns( + path: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Body + ) async throws -> Operations.SecretScanningBulkCreateRepoCustomPatterns.Output { + try await secretScanningBulkCreateRepoCustomPatterns(Operations.SecretScanningBulkCreateRepoCustomPatterns.Input( + path: path, + headers: headers, + body: body + )) + } + /// Bulk delete repository custom patterns + /// + /// Bulk deletes secret scanning custom patterns 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 `DELETE /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)`. + public func secretScanningBulkDeleteRepoCustomPatterns( + path: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Body + ) async throws -> Operations.SecretScanningBulkDeleteRepoCustomPatterns.Output { + try await secretScanningBulkDeleteRepoCustomPatterns(Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input( + path: path, + headers: headers, + body: body + )) + } + /// Update a repository custom pattern + /// + /// Updates a secret scanning custom pattern 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 `PATCH /repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)`. + public func secretScanningUpdateRepoCustomPattern( + path: Operations.SecretScanningUpdateRepoCustomPattern.Input.Path, + headers: Operations.SecretScanningUpdateRepoCustomPattern.Input.Headers = .init(), + body: Operations.SecretScanningUpdateRepoCustomPattern.Input.Body + ) async throws -> Operations.SecretScanningUpdateRepoCustomPattern.Output { + try await secretScanningUpdateRepoCustomPattern(Operations.SecretScanningUpdateRepoCustomPattern.Input( + path: path, + headers: headers, + body: body + )) + } /// Create a push protection bypass /// /// Creates a bypass for a previously push protected secret. @@ -2121,6 +2345,368 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-row-version`. public typealias SecretScanningRowVersion = Swift.String + /// A custom pattern for secret scanning. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern`. + public struct SecretScanningCustomPattern: Codable, Hashable, Sendable { + /// The ID of the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/id`. + public var id: Swift.Int + /// The name of the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/name`. + public var name: Swift.String + /// The regular expression of the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/pattern`. + public var pattern: Swift.String + /// A URL-friendly identifier for the custom pattern, derived from its name. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/slug`. + public var slug: Swift.String + /// The state of the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case published = "published" + case unpublished = "unpublished" + } + /// The state of the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/state`. + public var state: Components.Schemas.SecretScanningCustomPattern.StatePayload + /// Whether push protection is enabled for this custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/push_protection_enabled`. + public var pushProtectionEnabled: Swift.Bool + /// The start delimiter regex for the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/start_delimiter`. + public var startDelimiter: Swift.String? + /// The end delimiter regex for the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/end_delimiter`. + public var endDelimiter: Swift.String? + /// List of regexes that the secret must match. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/must_match`. + public var mustMatch: [Swift.String]? + /// List of regexes that the secret must not match. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/must_not_match`. + public var mustNotMatch: [Swift.String]? + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/custom_pattern_version`. + public var customPatternVersion: Components.Schemas.SecretScanningRowVersion? + /// The date and time the custom pattern was created in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/created_at`. + public var createdAt: Foundation.Date? + /// The date and time the custom pattern was last updated in ISO 8601 format. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern/updated_at`. + public var updatedAt: Foundation.Date? + /// Creates a new `SecretScanningCustomPattern`. + /// + /// - Parameters: + /// - id: The ID of the custom pattern. + /// - name: The name of the custom pattern. + /// - pattern: The regular expression of the custom pattern. + /// - slug: A URL-friendly identifier for the custom pattern, derived from its name. + /// - state: The state of the custom pattern. + /// - pushProtectionEnabled: Whether push protection is enabled for this custom pattern. + /// - startDelimiter: The start delimiter regex for the custom pattern. + /// - endDelimiter: The end delimiter regex for the custom pattern. + /// - mustMatch: List of regexes that the secret must match. + /// - mustNotMatch: List of regexes that the secret must not match. + /// - customPatternVersion: + /// - createdAt: The date and time the custom pattern was created in ISO 8601 format. + /// - updatedAt: The date and time the custom pattern was last updated in ISO 8601 format. + public init( + id: Swift.Int, + name: Swift.String, + pattern: Swift.String, + slug: Swift.String, + state: Components.Schemas.SecretScanningCustomPattern.StatePayload, + pushProtectionEnabled: Swift.Bool, + startDelimiter: Swift.String? = nil, + endDelimiter: Swift.String? = nil, + mustMatch: [Swift.String]? = nil, + mustNotMatch: [Swift.String]? = nil, + customPatternVersion: Components.Schemas.SecretScanningRowVersion? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil + ) { + self.id = id + self.name = name + self.pattern = pattern + self.slug = slug + self.state = state + self.pushProtectionEnabled = pushProtectionEnabled + self.startDelimiter = startDelimiter + self.endDelimiter = endDelimiter + self.mustMatch = mustMatch + self.mustNotMatch = mustNotMatch + self.customPatternVersion = customPatternVersion + self.createdAt = createdAt + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case id + case name + case pattern + case slug + case state + case pushProtectionEnabled = "push_protection_enabled" + case startDelimiter = "start_delimiter" + case endDelimiter = "end_delimiter" + case mustMatch = "must_match" + case mustNotMatch = "must_not_match" + case customPatternVersion = "custom_pattern_version" + case createdAt = "created_at" + case updatedAt = "updated_at" + } + } + /// A custom pattern to create in a bulk operation. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-create`. + public struct SecretScanningCustomPatternToCreate: Codable, Hashable, Sendable { + /// The name of the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-create/name`. + public var name: Swift.String + /// The regular expression of the custom pattern. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-create/pattern`. + public var pattern: Swift.String + /// The start delimiter regex for the custom pattern. + /// Defaults to `\A|[^0-9A-Za-z]` when not specified. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-create/start_delimiter`. + public var startDelimiter: Swift.String? + /// The end delimiter regex for the custom pattern. + /// Defaults to `\z|[^0-9A-Za-z]` when not specified. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-create/end_delimiter`. + public var endDelimiter: Swift.String? + /// List of regexes that the secret must match. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-create/must_match`. + public var mustMatch: [Swift.String]? + /// List of regexes that the secret must not match. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-create/must_not_match`. + public var mustNotMatch: [Swift.String]? + /// Creates a new `SecretScanningCustomPatternToCreate`. + /// + /// - Parameters: + /// - name: The name of the custom pattern. + /// - pattern: The regular expression of the custom pattern. + /// - startDelimiter: The start delimiter regex for the custom pattern. + /// - endDelimiter: The end delimiter regex for the custom pattern. + /// - mustMatch: List of regexes that the secret must match. + /// - mustNotMatch: List of regexes that the secret must not match. + public init( + name: Swift.String, + pattern: Swift.String, + startDelimiter: Swift.String? = nil, + endDelimiter: Swift.String? = nil, + mustMatch: [Swift.String]? = nil, + mustNotMatch: [Swift.String]? = nil + ) { + self.name = name + self.pattern = pattern + self.startDelimiter = startDelimiter + self.endDelimiter = endDelimiter + self.mustMatch = mustMatch + self.mustNotMatch = mustNotMatch + } + public enum CodingKeys: String, CodingKey { + case name + case pattern + case startDelimiter = "start_delimiter" + case endDelimiter = "end_delimiter" + case mustMatch = "must_match" + case mustNotMatch = "must_not_match" + } + } + /// A validation error for a custom pattern in a batch operation. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-validation-error`. + public struct SecretScanningCustomPatternValidationError: Codable, Hashable, Sendable { + /// A machine-readable code describing the error. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-validation-error/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case invalid = "invalid" + case unprocessable = "unprocessable" + case startDelimiter = "start_delimiter" + case endDelimiter = "end_delimiter" + case name = "name" + case mustMatch = "must_match" + case mustNotMatch = "must_not_match" + case customPatternVersionMismatch = "custom_pattern_version_mismatch" + } + /// A machine-readable code describing the error. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-validation-error/code`. + public var code: Components.Schemas.SecretScanningCustomPatternValidationError.CodePayload? + /// A human-readable description of the error. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-validation-error/message`. + public var message: Swift.String? + /// Creates a new `SecretScanningCustomPatternValidationError`. + /// + /// - Parameters: + /// - code: A machine-readable code describing the error. + /// - message: A human-readable description of the error. + public init( + code: Components.Schemas.SecretScanningCustomPatternValidationError.CodePayload? = nil, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// A custom pattern to delete in a bulk operation. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-delete`. + public struct SecretScanningCustomPatternToDelete: Codable, Hashable, Sendable { + /// The ID of the custom pattern to delete. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-delete/pattern_id`. + public var patternId: Swift.Int + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-delete/custom_pattern_version`. + public var customPatternVersion: Components.Schemas.SecretScanningRowVersion? + /// Creates a new `SecretScanningCustomPatternToDelete`. + /// + /// - Parameters: + /// - patternId: The ID of the custom pattern to delete. + /// - customPatternVersion: + public init( + patternId: Swift.Int, + customPatternVersion: Components.Schemas.SecretScanningRowVersion? = nil + ) { + self.patternId = patternId + self.customPatternVersion = customPatternVersion + } + public enum CodingKeys: String, CodingKey { + case patternId = "pattern_id" + case customPatternVersion = "custom_pattern_version" + } + } + /// Fields to update on a custom pattern. At least one updatable field (`pattern`, `start_delimiter`, `end_delimiter`, `must_match`, or `must_not_match`) must also be provided. Only provided fields will be updated. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update`. + public struct SecretScanningCustomPatternToUpdate: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Creates a new `Value1Payload`. + public init() {} + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value1`. + public var value1: Components.Schemas.SecretScanningCustomPatternToUpdate.Value1Payload? + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Creates a new `Value2Payload`. + public init() {} + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value2`. + public var value2: Components.Schemas.SecretScanningCustomPatternToUpdate.Value2Payload? + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value3`. + public struct Value3Payload: Codable, Hashable, Sendable { + /// Creates a new `Value3Payload`. + public init() {} + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value3`. + public var value3: Components.Schemas.SecretScanningCustomPatternToUpdate.Value3Payload? + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value4`. + public struct Value4Payload: Codable, Hashable, Sendable { + /// Creates a new `Value4Payload`. + public init() {} + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value4`. + public var value4: Components.Schemas.SecretScanningCustomPatternToUpdate.Value4Payload? + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value5`. + public struct Value5Payload: Codable, Hashable, Sendable { + /// Creates a new `Value5Payload`. + public init() {} + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-custom-pattern-to-update/value5`. + public var value5: Components.Schemas.SecretScanningCustomPatternToUpdate.Value5Payload? + /// Creates a new `SecretScanningCustomPatternToUpdate`. + /// + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + /// - value4: + /// - value5: + public init( + value1: Components.Schemas.SecretScanningCustomPatternToUpdate.Value1Payload? = nil, + value2: Components.Schemas.SecretScanningCustomPatternToUpdate.Value2Payload? = nil, + value3: Components.Schemas.SecretScanningCustomPatternToUpdate.Value3Payload? = nil, + value4: Components.Schemas.SecretScanningCustomPatternToUpdate.Value4Payload? = nil, + value5: Components.Schemas.SecretScanningCustomPatternToUpdate.Value5Payload? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + self.value4 = value4 + self.value5 = value5 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value3 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value4 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value5 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3, + self.value4, + self.value5 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + try self.value3?.encode(to: encoder) + try self.value4?.encode(to: encoder) + try self.value5?.encode(to: encoder) + } + } /// - Remark: Generated from `#/components/schemas/secret-scanning-pattern-override`. public struct SecretScanningPatternOverride: Codable, Hashable, Sendable { /// The ID of the pattern. @@ -2548,30 +3134,325 @@ public enum Components { case closureRequestReviewer = "closure_request_reviewer" } } - /// - Remark: Generated from `#/components/schemas/secret-scanning-location`. - public struct SecretScanningLocation: Codable, Hashable, Sendable { - /// The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. + /// - Remark: Generated from `#/components/schemas/SecretScanningAlertMetadata`. + public struct SecretScanningAlertMetadataPayload: Codable, Hashable, Sendable { + /// The metadata key. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location/type`. - @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { - case commit = "commit" - case wikiCommit = "wiki_commit" - case issueTitle = "issue_title" - case issueBody = "issue_body" - case issueComment = "issue_comment" - case discussionTitle = "discussion_title" - case discussionBody = "discussion_body" - case discussionComment = "discussion_comment" - case pullRequestTitle = "pull_request_title" - case pullRequestBody = "pull_request_body" - case pullRequestComment = "pull_request_comment" - case pullRequestReview = "pull_request_review" - case pullRequestReviewComment = "pull_request_review_comment" - } - /// The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. + /// - Remark: Generated from `#/components/schemas/SecretScanningAlertMetadata/key`. + public var key: Swift.String + /// The metadata value. /// - /// - Remark: Generated from `#/components/schemas/secret-scanning-location/type`. - public var _type: Components.Schemas.SecretScanningLocation._TypePayload? + /// - Remark: Generated from `#/components/schemas/SecretScanningAlertMetadata/value`. + public var value: Swift.String + /// Creates a new `SecretScanningAlertMetadataPayload`. + /// + /// - Parameters: + /// - key: The metadata key. + /// - value: The metadata value. + public init( + key: Swift.String, + value: Swift.String + ) { + self.key = key + self.value = value + } + public enum CodingKeys: String, CodingKey { + case key + case value + } + } + /// A list of metadata key/value pairs associated with the secret scanning alert. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-metadata`. + public typealias SecretScanningAlertMetadata = [Components.Schemas.SecretScanningAlertMetadataPayload] + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata`. + public struct SecretScanningAlertWithMetadata: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/number`. + public var number: Components.Schemas.AlertNumber? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/created_at`. + public var createdAt: Components.Schemas.AlertCreatedAt? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/updated_at`. + public var updatedAt: Components.Schemas.NullableAlertUpdatedAt? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/url`. + public var url: Components.Schemas.AlertUrl? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/html_url`. + public var htmlUrl: Components.Schemas.AlertHtmlUrl? + /// The REST API URL of the code locations for this alert. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/locations_url`. + public var locationsUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/state`. + public var state: Components.Schemas.SecretScanningAlertState? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/resolution`. + public var resolution: Components.Schemas.SecretScanningAlertResolution? + /// The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/resolved_at`. + public var resolvedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/resolved_by`. + public var resolvedBy: Components.Schemas.NullableSimpleUser? + /// An optional comment to resolve an alert. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/resolution_comment`. + public var resolutionComment: Swift.String? + /// The type of secret that secret scanning detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/secret_type`. + public var secretType: Swift.String? + /// User-friendly name for the detected secret, matching the `secret_type`. + /// For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/secret_type_display_name`. + public var secretTypeDisplayName: Swift.String? + /// The provider of the secret that was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/provider`. + public var provider: Swift.String? + /// The slug identifier for the provider of the secret that was detected. Use this value for filtering by provider with the `providers` or `exclude_providers` parameters. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/provider_slug`. + public var providerSlug: Swift.String? + /// The secret that was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/secret`. + public var secret: Swift.String? + /// Whether push protection was bypassed for the detected secret. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/push_protection_bypassed`. + public var pushProtectionBypassed: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/push_protection_bypassed_by`. + public var pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? + /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/push_protection_bypassed_at`. + public var pushProtectionBypassedAt: Foundation.Date? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/push_protection_bypass_request_reviewer`. + public var pushProtectionBypassRequestReviewer: Components.Schemas.NullableSimpleUser? + /// An optional comment when reviewing a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/push_protection_bypass_request_reviewer_comment`. + public var pushProtectionBypassRequestReviewerComment: Swift.String? + /// An optional comment when requesting a push protection bypass. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/push_protection_bypass_request_comment`. + public var pushProtectionBypassRequestComment: Swift.String? + /// The URL to a push protection bypass request. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/push_protection_bypass_request_html_url`. + public var pushProtectionBypassRequestHtmlUrl: Swift.String? + /// The token status as of the latest validity check. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/validity`. + @frozen public enum ValidityPayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case inactive = "inactive" + case unknown = "unknown" + } + /// The token status as of the latest validity check. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/validity`. + public var validity: Components.Schemas.SecretScanningAlertWithMetadata.ValidityPayload? + /// Whether the detected secret was publicly leaked. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/publicly_leaked`. + public var publiclyLeaked: Swift.Bool? + /// Whether the detected secret was found in multiple repositories under the same organization or enterprise. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/multi_repo`. + public var multiRepo: Swift.Bool? + /// A boolean value representing whether or not alert is base64 encoded + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/is_base64_encoded`. + public var isBase64Encoded: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/first_location_detected`. + public var firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? + /// A boolean value representing whether or not the token in the alert was detected in more than one location. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/has_more_locations`. + public var hasMoreLocations: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/assigned_to`. + public var assignedTo: Components.Schemas.NullableSimpleUser? + /// An optional comment from the closure request author. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/closure_request_comment`. + public var closureRequestComment: Swift.String? + /// An optional comment from the closure request reviewer. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/closure_request_reviewer_comment`. + public var closureRequestReviewerComment: Swift.String? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/closure_request_reviewer`. + public var closureRequestReviewer: Components.Schemas.NullableSimpleUser? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert-with-metadata/metadata`. + public var metadata: Components.Schemas.SecretScanningAlertMetadata? + /// Creates a new `SecretScanningAlertWithMetadata`. + /// + /// - Parameters: + /// - number: + /// - createdAt: + /// - updatedAt: + /// - url: + /// - htmlUrl: + /// - locationsUrl: The REST API URL of the code locations for this alert. + /// - state: + /// - resolution: + /// - resolvedAt: The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - resolvedBy: + /// - resolutionComment: An optional comment to resolve an alert. + /// - secretType: The type of secret that secret scanning detected. + /// - secretTypeDisplayName: User-friendly name for the detected secret, matching the `secret_type`. + /// - provider: The provider of the secret that was detected. + /// - providerSlug: The slug identifier for the provider of the secret that was detected. Use this value for filtering by provider with the `providers` or `exclude_providers` parameters. + /// - secret: The secret that was detected. + /// - pushProtectionBypassed: Whether push protection was bypassed for the detected secret. + /// - pushProtectionBypassedBy: + /// - pushProtectionBypassedAt: The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + /// - pushProtectionBypassRequestReviewer: + /// - pushProtectionBypassRequestReviewerComment: An optional comment when reviewing a push protection bypass. + /// - pushProtectionBypassRequestComment: An optional comment when requesting a push protection bypass. + /// - pushProtectionBypassRequestHtmlUrl: The URL to a push protection bypass request. + /// - validity: The token status as of the latest validity check. + /// - publiclyLeaked: Whether the detected secret was publicly leaked. + /// - multiRepo: Whether the detected secret was found in multiple repositories under the same organization or enterprise. + /// - isBase64Encoded: A boolean value representing whether or not alert is base64 encoded + /// - firstLocationDetected: + /// - hasMoreLocations: A boolean value representing whether or not the token in the alert was detected in more than one location. + /// - assignedTo: + /// - closureRequestComment: An optional comment from the closure request author. + /// - closureRequestReviewerComment: An optional comment from the closure request reviewer. + /// - closureRequestReviewer: + /// - metadata: + public init( + number: Components.Schemas.AlertNumber? = nil, + createdAt: Components.Schemas.AlertCreatedAt? = nil, + updatedAt: Components.Schemas.NullableAlertUpdatedAt? = nil, + url: Components.Schemas.AlertUrl? = nil, + htmlUrl: Components.Schemas.AlertHtmlUrl? = nil, + locationsUrl: Swift.String? = nil, + state: Components.Schemas.SecretScanningAlertState? = nil, + resolution: Components.Schemas.SecretScanningAlertResolution? = nil, + resolvedAt: Foundation.Date? = nil, + resolvedBy: Components.Schemas.NullableSimpleUser? = nil, + resolutionComment: Swift.String? = nil, + secretType: Swift.String? = nil, + secretTypeDisplayName: Swift.String? = nil, + provider: Swift.String? = nil, + providerSlug: Swift.String? = nil, + secret: Swift.String? = nil, + pushProtectionBypassed: Swift.Bool? = nil, + pushProtectionBypassedBy: Components.Schemas.NullableSimpleUser? = nil, + pushProtectionBypassedAt: Foundation.Date? = nil, + pushProtectionBypassRequestReviewer: Components.Schemas.NullableSimpleUser? = nil, + pushProtectionBypassRequestReviewerComment: Swift.String? = nil, + pushProtectionBypassRequestComment: Swift.String? = nil, + pushProtectionBypassRequestHtmlUrl: Swift.String? = nil, + validity: Components.Schemas.SecretScanningAlertWithMetadata.ValidityPayload? = nil, + publiclyLeaked: Swift.Bool? = nil, + multiRepo: Swift.Bool? = nil, + isBase64Encoded: Swift.Bool? = nil, + firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? = nil, + hasMoreLocations: Swift.Bool? = nil, + assignedTo: Components.Schemas.NullableSimpleUser? = nil, + closureRequestComment: Swift.String? = nil, + closureRequestReviewerComment: Swift.String? = nil, + closureRequestReviewer: Components.Schemas.NullableSimpleUser? = nil, + metadata: Components.Schemas.SecretScanningAlertMetadata? = nil + ) { + self.number = number + self.createdAt = createdAt + self.updatedAt = updatedAt + self.url = url + self.htmlUrl = htmlUrl + self.locationsUrl = locationsUrl + self.state = state + self.resolution = resolution + self.resolvedAt = resolvedAt + self.resolvedBy = resolvedBy + self.resolutionComment = resolutionComment + self.secretType = secretType + self.secretTypeDisplayName = secretTypeDisplayName + self.provider = provider + self.providerSlug = providerSlug + self.secret = secret + self.pushProtectionBypassed = pushProtectionBypassed + self.pushProtectionBypassedBy = pushProtectionBypassedBy + self.pushProtectionBypassedAt = pushProtectionBypassedAt + self.pushProtectionBypassRequestReviewer = pushProtectionBypassRequestReviewer + self.pushProtectionBypassRequestReviewerComment = pushProtectionBypassRequestReviewerComment + self.pushProtectionBypassRequestComment = pushProtectionBypassRequestComment + self.pushProtectionBypassRequestHtmlUrl = pushProtectionBypassRequestHtmlUrl + self.validity = validity + self.publiclyLeaked = publiclyLeaked + self.multiRepo = multiRepo + self.isBase64Encoded = isBase64Encoded + self.firstLocationDetected = firstLocationDetected + self.hasMoreLocations = hasMoreLocations + self.assignedTo = assignedTo + self.closureRequestComment = closureRequestComment + self.closureRequestReviewerComment = closureRequestReviewerComment + self.closureRequestReviewer = closureRequestReviewer + self.metadata = metadata + } + public enum CodingKeys: String, CodingKey { + case number + case createdAt = "created_at" + case updatedAt = "updated_at" + case url + case htmlUrl = "html_url" + case locationsUrl = "locations_url" + case state + case resolution + case resolvedAt = "resolved_at" + case resolvedBy = "resolved_by" + case resolutionComment = "resolution_comment" + case secretType = "secret_type" + case secretTypeDisplayName = "secret_type_display_name" + case provider + case providerSlug = "provider_slug" + case secret + case pushProtectionBypassed = "push_protection_bypassed" + case pushProtectionBypassedBy = "push_protection_bypassed_by" + case pushProtectionBypassedAt = "push_protection_bypassed_at" + case pushProtectionBypassRequestReviewer = "push_protection_bypass_request_reviewer" + case pushProtectionBypassRequestReviewerComment = "push_protection_bypass_request_reviewer_comment" + case pushProtectionBypassRequestComment = "push_protection_bypass_request_comment" + case pushProtectionBypassRequestHtmlUrl = "push_protection_bypass_request_html_url" + case validity + case publiclyLeaked = "publicly_leaked" + case multiRepo = "multi_repo" + case isBase64Encoded = "is_base64_encoded" + case firstLocationDetected = "first_location_detected" + case hasMoreLocations = "has_more_locations" + case assignedTo = "assigned_to" + case closureRequestComment = "closure_request_comment" + case closureRequestReviewerComment = "closure_request_reviewer_comment" + case closureRequestReviewer = "closure_request_reviewer" + case metadata + } + } + /// - Remark: Generated from `#/components/schemas/secret-scanning-location`. + public struct SecretScanningLocation: Codable, Hashable, Sendable { + /// The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case commit = "commit" + case wikiCommit = "wiki_commit" + case issueTitle = "issue_title" + case issueBody = "issue_body" + case issueComment = "issue_comment" + case discussionTitle = "discussion_title" + case discussionBody = "discussion_body" + case discussionComment = "discussion_comment" + case pullRequestTitle = "pull_request_title" + case pullRequestBody = "pull_request_body" + case pullRequestComment = "pull_request_comment" + case pullRequestReview = "pull_request_review" + case pullRequestReviewComment = "pull_request_review_comment" + } + /// The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location/type`. + public var _type: Components.Schemas.SecretScanningLocation._TypePayload? /// - Remark: Generated from `#/components/schemas/secret-scanning-location/details`. @frozen public enum DetailsPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/secret-scanning-location/details/case1`. @@ -3026,12 +3907,49 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-bypassed`. public typealias SecretScanningAlertBypassed = Swift.Bool - /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// A comma-separated list of metadata fields to filter alerts by. Only alerts that have all of the + /// specified metadata fields attached will be returned. Possible values are: `owner-email`, `owner-id`, + /// `owner-name`, `secret-id`, `secret-name`, `secret-issued-date`, `secret-expiration-date`, `organization-name`, + /// `organization-id`, `last-used-date`, and `has-organization-access`. /// - /// - Remark: Generated from `#/components/parameters/alert-number`. - public typealias AlertNumber = Components.Schemas.AlertNumber - } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-included-metadata`. + public typealias SecretScanningAlertIncludedMetadata = Swift.String + /// Filters alerts to only those whose attached `owner_email` metadata field matches the + /// provided value. The value must be the lowercase hex-encoded SHA-256 hash of the email + /// address to match (for example, the SHA-256 of `user@example.com`). Only alerts that + /// have an `owner_email` metadata value whose SHA-256 hash equals this parameter are + /// returned. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-owner-email-hash`. + public typealias SecretScanningAlertOwnerEmailHash = Swift.String + /// Filter custom patterns by state. When absent, returns patterns in all states. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-state`. + @frozen public enum SecretScanningCustomPatternState: String, Codable, Hashable, Sendable, CaseIterable { + case published = "published" + case unpublished = "unpublished" + } + /// Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-push-protection`. + @frozen public enum SecretScanningCustomPatternPushProtection: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-sort`. + @frozen public enum SecretScanningCustomPatternSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case name = "name" + } + /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// + /// - Remark: Generated from `#/components/parameters/alert-number`. + public typealias AlertNumber = Components.Schemas.AlertNumber + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. public enum Responses { @@ -3260,6 +4178,34 @@ public enum Components { self.body = body } } + public struct PreconditionFailed: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/precondition_failed/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/precondition_failed/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.PreconditionFailed.Body + /// Creates a new `PreconditionFailed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.PreconditionFailed.Body) { + self.body = body + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers { @@ -3393,6 +4339,21 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/is_bypassed`. public var isBypassed: Components.Parameters.SecretScanningAlertBypassed? + /// A comma-separated list of metadata fields to filter alerts by. Only alerts that have all of the + /// specified metadata fields attached will be returned. Possible values are: `owner-email`, `owner-id`, + /// `owner-name`, `secret-id`, `secret-name`, `secret-issued-date`, `secret-expiration-date`, `organization-name`, + /// `organization-id`, `last-used-date`, and `has-organization-access`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/included_metadata`. + public var includedMetadata: Components.Parameters.SecretScanningAlertIncludedMetadata? + /// Filters alerts to only those whose attached `owner_email` metadata field matches the + /// provided value. The value must be the lowercase hex-encoded SHA-256 hash of the email + /// address to match (for example, the SHA-256 of `user@example.com`). Only alerts that + /// have an `owner_email` metadata value whose SHA-256 hash equals this parameter are + /// returned. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/alerts/GET/query/owner_email_hash`. + public var ownerEmailHash: Components.Parameters.SecretScanningAlertOwnerEmailHash? /// Creates a new `Query`. /// /// - Parameters: @@ -3414,6 +4375,8 @@ public enum Operations { /// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. /// - isBypassed: A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. + /// - includedMetadata: A comma-separated list of metadata fields to filter alerts by. Only alerts that have all of the + /// - ownerEmailHash: Filters alerts to only those whose attached `owner_email` metadata field matches the public init( state: Components.Parameters.SecretScanningAlertState? = nil, secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, @@ -3432,7 +4395,9 @@ public enum Operations { isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil, hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil, - isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil + isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil, + includedMetadata: Components.Parameters.SecretScanningAlertIncludedMetadata? = nil, + ownerEmailHash: Components.Parameters.SecretScanningAlertOwnerEmailHash? = nil ) { self.state = state self.secretType = secretType @@ -3452,6 +4417,8 @@ public enum Operations { self.isMultiRepo = isMultiRepo self.hideSecret = hideSecret self.isBypassed = isBypassed + self.includedMetadata = includedMetadata + self.ownerEmailHash = ownerEmailHash } } public var query: Operations.SecretScanningListAlertsForOrg.Input.Query @@ -3631,22 +4598,22 @@ public enum Operations { } } } - /// List organization pattern configurations + /// List organization custom patterns /// - /// Lists the secret scanning pattern configurations for an organization. + /// Lists secret scanning custom patterns for an organization. /// /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. - public enum SecretScanningListOrgPatternConfigs { - public static let id: Swift.String = "secret-scanning/list-org-pattern-configs" + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/get(secret-scanning/list-org-custom-patterns)`. + public enum SecretScanningListOrgCustomPatterns { + public static let id: Swift.String = "secret-scanning/list-org-custom-patterns" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -3656,43 +4623,133 @@ public enum Operations { self.org = org } } - public var path: Operations.SecretScanningListOrgPatternConfigs.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/header`. + public var path: Operations.SecretScanningListOrgCustomPatterns.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-state`. + @frozen public enum SecretScanningCustomPatternState: String, Codable, Hashable, Sendable, CaseIterable { + case published = "published" + case unpublished = "unpublished" + } + /// Filter custom patterns by state. When absent, returns patterns in all states. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/query/state`. + public var state: Components.Parameters.SecretScanningCustomPatternState? + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-push-protection`. + @frozen public enum SecretScanningCustomPatternPushProtection: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/query/push_protection`. + public var pushProtection: Components.Parameters.SecretScanningCustomPatternPushProtection? + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-sort`. + @frozen public enum SecretScanningCustomPatternSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case name = "name" + } + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/query/sort`. + public var sort: Components.Parameters.SecretScanningCustomPatternSort? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Filter custom patterns by state. When absent, returns patterns in all states. + /// - pushProtection: Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status. + /// - sort: The property to sort the results by. + /// - direction: The direction to sort the results by. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + state: Components.Parameters.SecretScanningCustomPatternState? = nil, + pushProtection: Components.Parameters.SecretScanningCustomPatternPushProtection? = nil, + sort: Components.Parameters.SecretScanningCustomPatternSort? = nil, + direction: Components.Parameters.Direction? = nil, + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.state = state + self.pushProtection = pushProtection + self.sort = sort + self.direction = direction + self.page = page + self.perPage = perPage + } + } + public var query: Operations.SecretScanningListOrgCustomPatterns.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SecretScanningListOrgPatternConfigs.Input.Headers + public var headers: Operations.SecretScanningListOrgCustomPatterns.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.SecretScanningListOrgPatternConfigs.Input.Path, - headers: Operations.SecretScanningListOrgPatternConfigs.Input.Headers = .init() + path: Operations.SecretScanningListOrgCustomPatterns.Input.Path, + query: Operations.SecretScanningListOrgCustomPatterns.Input.Query = .init(), + headers: Operations.SecretScanningListOrgCustomPatterns.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/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.SecretScanningListOrgCustomPatterns.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/responses/200/content/application\/json`. - case json(Components.Schemas.SecretScanningPatternConfiguration) + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SecretScanningCustomPattern]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.SecretScanningPatternConfiguration { + public var json: [Components.Schemas.SecretScanningCustomPattern] { get throws { switch self { case let .json(body): @@ -3702,26 +4759,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body + public var body: Operations.SecretScanningListOrgCustomPatterns.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body) { + public init( + headers: Operations.SecretScanningListOrgCustomPatterns.Output.Ok.Headers = .init(), + body: Operations.SecretScanningListOrgCustomPatterns.Output.Ok.Body + ) { + self.headers = headers self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/get(secret-scanning/list-org-custom-patterns)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningListOrgPatternConfigs.Output.Ok) + case ok(Operations.SecretScanningListOrgCustomPatterns.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.SecretScanningListOrgPatternConfigs.Output.Ok { + public var ok: Operations.SecretScanningListOrgCustomPatterns.Output.Ok { get throws { switch self { case let .ok(response): @@ -3736,7 +4798,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/get(secret-scanning/list-org-custom-patterns)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -3759,7 +4821,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/get(secret-scanning/list-org-custom-patterns)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -3811,22 +4873,22 @@ public enum Operations { } } } - /// Update organization pattern configurations + /// Bulk create organization custom patterns /// - /// Updates the secret scanning pattern configurations for an organization. + /// Bulk creates secret scanning custom patterns for an organization. /// /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. /// - /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. - public enum SecretScanningUpdateOrgPatternConfigs { - public static let id: Swift.String = "secret-scanning/update-org-pattern-configs" + /// - Remark: HTTP `POST /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)`. + public enum SecretScanningBulkCreateOrgCustomPatterns { + public static let id: Swift.String = "secret-scanning/bulk-create-org-custom-patterns" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -3836,141 +4898,42 @@ public enum Operations { self.org = org } } - public var path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/header`. + public var path: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody`. + public var headers: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/pattern_config_version`. - public var patternConfigVersion: Components.Schemas.SecretScanningRowVersion? - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload`. - public struct ProviderPatternSettingsPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the pattern to configure. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/token_type`. - public var tokenType: Swift.String? - /// Push protection setting to set for the pattern. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. - @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { - case notSet = "not-set" - case disabled = "disabled" - case enabled = "enabled" - } - /// Push protection setting to set for the pattern. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. - public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? - /// Creates a new `ProviderPatternSettingsPayloadPayload`. - /// - /// - Parameters: - /// - tokenType: The ID of the pattern to configure. - /// - pushProtectionSetting: Push protection setting to set for the pattern. - public init( - tokenType: Swift.String? = nil, - pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil - ) { - self.tokenType = tokenType - self.pushProtectionSetting = pushProtectionSetting - } - public enum CodingKeys: String, CodingKey { - case tokenType = "token_type" - case pushProtectionSetting = "push_protection_setting" - } - } - /// Pattern settings for provider patterns. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. - public typealias ProviderPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload] - /// Pattern settings for provider patterns. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. - public var providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload`. - public struct CustomPatternSettingsPayloadPayload: Codable, Hashable, Sendable { - /// The ID of the pattern to configure. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/token_type`. - public var tokenType: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/custom_pattern_version`. - public var customPatternVersion: Components.Schemas.SecretScanningRowVersion? - /// Push protection setting to set for the pattern. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. - @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { - case disabled = "disabled" - case enabled = "enabled" - } - /// Push protection setting to set for the pattern. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. - public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? - /// Creates a new `CustomPatternSettingsPayloadPayload`. - /// - /// - Parameters: - /// - tokenType: The ID of the pattern to configure. - /// - customPatternVersion: - /// - pushProtectionSetting: Push protection setting to set for the pattern. - public init( - tokenType: Swift.String? = nil, - customPatternVersion: Components.Schemas.SecretScanningRowVersion? = nil, - pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil - ) { - self.tokenType = tokenType - self.customPatternVersion = customPatternVersion - self.pushProtectionSetting = pushProtectionSetting - } - public enum CodingKeys: String, CodingKey { - case tokenType = "token_type" - case customPatternVersion = "custom_pattern_version" - case pushProtectionSetting = "push_protection_setting" - } - } - /// Pattern settings for custom patterns. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. - public typealias CustomPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload] - /// Pattern settings for custom patterns. + /// The list of custom patterns to create. /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. - public var customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/requestBody/json/patterns`. + public var patterns: [Components.Schemas.SecretScanningCustomPatternToCreate] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - patternConfigVersion: - /// - providerPatternSettings: Pattern settings for provider patterns. - /// - customPatternSettings: Pattern settings for custom patterns. - public init( - patternConfigVersion: Components.Schemas.SecretScanningRowVersion? = nil, - providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? = nil, - customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? = nil - ) { - self.patternConfigVersion = patternConfigVersion - self.providerPatternSettings = providerPatternSettings - self.customPatternSettings = customPatternSettings + /// - patterns: The list of custom patterns to create. + public init(patterns: [Components.Schemas.SecretScanningCustomPatternToCreate]) { + self.patterns = patterns } public enum CodingKeys: String, CodingKey { - case patternConfigVersion = "pattern_config_version" - case providerPatternSettings = "provider_pattern_settings" - case customPatternSettings = "custom_pattern_settings" + case patterns } } - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/content/application\/json`. - case json(Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/requestBody/content/application\/json`. + case json(Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Body.JsonPayload) } - public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body + public var body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -3978,9 +4941,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path, - headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers = .init(), - body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body + path: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Input.Body ) { self.path = path self.headers = headers @@ -3988,33 +4951,33 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/201/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The updated pattern configuration version. + /// The list of successfully created custom patterns. /// - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json/pattern_config_version`. - public var patternConfigVersion: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/201/content/json/created_patterns`. + public var createdPatterns: [Components.Schemas.SecretScanningCustomPattern]? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - patternConfigVersion: The updated pattern configuration version. - public init(patternConfigVersion: Swift.String? = nil) { - self.patternConfigVersion = patternConfigVersion + /// - createdPatterns: The list of successfully created custom patterns. + public init(createdPatterns: [Components.Schemas.SecretScanningCustomPattern]? = nil) { + self.createdPatterns = createdPatterns } public enum CodingKeys: String, CodingKey { - case patternConfigVersion = "pattern_config_version" + case createdPatterns = "created_patterns" } } - /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/application\/json`. - case json(Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/201/content/application\/json`. + case json(Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload { + public var json: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -4024,33 +4987,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body) { + public init(body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created.Body) { self.body = body } } - /// Response + /// All patterns created successfully. /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } @@ -4058,7 +5021,7 @@ public enum Operations { } /// Bad Request /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/400`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)/responses/400`. /// /// HTTP response code: `400 badRequest`. case badRequest(Components.Responses.BadRequest) @@ -4081,7 +5044,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4104,7 +5067,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -4125,40 +5088,109 @@ public enum Operations { } } } - /// Conflict - /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/409`. - /// - /// HTTP response code: `409 conflict`. - case conflict(Components.Responses.Conflict) - /// The associated value of the enum case if `self` is `.conflict`. - /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Components.Responses.Conflict { - get throws { - switch self { - case let .conflict(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "conflict", - response: self - ) + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// A summary message describing the error. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content/json/message`. + public var message: Swift.String? + /// A map of validation errors keyed by the zero-based index of the pattern that failed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors`. + public struct ValidationErrorsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors/additionalProperties`. + public struct AdditionalPropertiesPayload: Codable, Hashable, Sendable { + /// List of validation errors for this pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors/additionalProperties/errors`. + public var errors: [Components.Schemas.SecretScanningCustomPatternValidationError]? + /// Creates a new `AdditionalPropertiesPayload`. + /// + /// - Parameters: + /// - errors: List of validation errors for this pattern. + public init(errors: [Components.Schemas.SecretScanningCustomPatternValidationError]? = nil) { + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case errors + } + } + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload.AdditionalPropertiesPayload] + /// Creates a new `ValidationErrorsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload.AdditionalPropertiesPayload] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// A map of validation errors keyed by the zero-based index of the pattern that failed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors`. + public var validationErrors: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: A summary message describing the error. + /// - validationErrors: A map of validation errors keyed by the zero-based index of the pattern that failed. + public init( + message: Swift.String? = nil, + validationErrors: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload? = nil + ) { + self.message = message + self.validationErrors = validationErrors + } + public enum CodingKeys: String, CodingKey { + case message + case validationErrors = "validation_errors" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/POST/responses/422/content/application\/json`. + case json(Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } } } + /// Received HTTP response body + public var body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent.Body) { + self.body = body + } } - /// Validation failed, or the endpoint has been spammed. + /// Validation failed for one or more patterns. /// - /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-org-custom-patterns)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) + case unprocessableContent(Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailed { + public var unprocessableContent: Operations.SecretScanningBulkCreateOrgCustomPatterns.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -4208,303 +5240,199 @@ public enum Operations { } } } - /// List secret scanning alerts for a repository + /// Bulk delete organization custom patterns /// - /// Lists secret scanning alerts for an eligible repository, from newest to oldest. - /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Bulk deletes secret scanning custom patterns for an organization. /// - /// 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. + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)`. - public enum SecretScanningListAlertsForRepo { - public static let id: Swift.String = "secret-scanning/list-alerts-for-repo" + /// - Remark: HTTP `DELETE /orgs/{org}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)`. + public enum SecretScanningBulkDeleteOrgCustomPatterns { + public static let id: Swift.String = "secret-scanning/bulk-delete-org-custom-patterns" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/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}/secret-scanning/alerts/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/path/repo`. - public var repo: Components.Parameters.Repo + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/path/org`. + public var org: Components.Parameters.Org /// 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 + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org } } - public var path: Operations.SecretScanningListAlertsForRepo.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-state`. - @frozen public enum SecretScanningAlertState: String, Codable, Hashable, Sendable, CaseIterable { - case open = "open" - case resolved = "resolved" - } - /// Set to `open` or `resolved` to only list secret scanning alerts in a specific state. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/state`. - public var state: Components.Parameters.SecretScanningAlertState? - /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/secret_type`. - public var secretType: Components.Parameters.SecretScanningAlertSecretType? - /// A comma-separated list of secret types to exclude from the results. All default secret patterns are returned except those matching the specified types. Cannot be combined with the `secret_type` parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/exclude_secret_types`. - public var excludeSecretTypes: Components.Parameters.SecretScanningAlertExcludeSecretTypes? - /// A comma-separated list of provider slugs to exclude from the results. - /// Provider slugs use lowercase with underscores (e.g., `github_secret_scanning`, `clojars`). - /// You can find the provider slug in the `provider_slug` field of each alert. - /// Cannot be combined with the `providers` parameter. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/exclude_providers`. - public var excludeProviders: Components.Parameters.SecretScanningAlertExcludeProviders? - /// A comma-separated list of provider slugs to filter by. - /// Provider slugs use lowercase with underscores (e.g., `github_secret_scanning`, `clojars`). - /// You can find the provider slug in the `provider_slug` field of each alert. - /// Cannot be combined with the `exclude_providers` parameter. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/providers`. - public var providers: Components.Parameters.SecretScanningAlertProviders? - /// A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/resolution`. - public var resolution: Components.Parameters.SecretScanningAlertResolution? - /// Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. + public var path: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/assignee`. - public var assignee: Components.Parameters.SecretScanningAlertAssignee? - /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-sort`. - @frozen public enum SecretScanningAlertSort: String, Codable, Hashable, Sendable, CaseIterable { - case created = "created" - case updated = "updated" + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept } - /// The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/sort`. - public var sort: Components.Parameters.SecretScanningAlertSort? - /// - Remark: Generated from `#/components/parameters/direction`. - @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { - case asc = "asc" - case desc = "desc" - } - /// The direction to sort the results by. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/direction`. - public var direction: Components.Parameters.Direction? - /// 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}/secret-scanning/alerts/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/before`. - public var before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? - /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/after`. - public var after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? - /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/validity`. - public var validity: Components.Parameters.SecretScanningAlertValidity? - /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_publicly_leaked`. - public var isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? - /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_multi_repo`. - public var isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? - /// A boolean value representing whether or not to hide literal secrets in the results. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/hide_secret`. - public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? - /// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_bypassed`. - public var isBypassed: Components.Parameters.SecretScanningAlertBypassed? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. - /// - secretType: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. - /// - excludeSecretTypes: A comma-separated list of secret types to exclude from the results. All default secret patterns are returned except those matching the specified types. Cannot be combined with the `secret_type` parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. - /// - excludeProviders: A comma-separated list of provider slugs to exclude from the results. - /// - providers: A comma-separated list of provider slugs to filter by. - /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. - /// - assignee: Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. - /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. - /// - direction: The direction to sort the results by. - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. - /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. - /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. - /// - isPubliclyLeaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. - /// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. - /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. - /// - isBypassed: A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. - public init( - state: Components.Parameters.SecretScanningAlertState? = nil, - secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, - excludeSecretTypes: Components.Parameters.SecretScanningAlertExcludeSecretTypes? = nil, - excludeProviders: Components.Parameters.SecretScanningAlertExcludeProviders? = nil, - providers: Components.Parameters.SecretScanningAlertProviders? = nil, - resolution: Components.Parameters.SecretScanningAlertResolution? = nil, - assignee: Components.Parameters.SecretScanningAlertAssignee? = nil, - sort: Components.Parameters.SecretScanningAlertSort? = nil, - direction: Components.Parameters.Direction? = nil, - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil, - before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? = nil, - after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? = nil, - validity: Components.Parameters.SecretScanningAlertValidity? = nil, - isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, - isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil, - hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil, - isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil - ) { - self.state = state - self.secretType = secretType - self.excludeSecretTypes = excludeSecretTypes - self.excludeProviders = excludeProviders - self.providers = providers - self.resolution = resolution - self.assignee = assignee - self.sort = sort - self.direction = direction - self.page = page - self.perPage = perPage - self.before = before - self.after = after - self.validity = validity - self.isPubliclyLeaked = isPubliclyLeaked - self.isMultiRepo = isMultiRepo - self.hideSecret = hideSecret - self.isBypassed = isBypassed - } - } - public var query: Operations.SecretScanningListAlertsForRepo.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + } + public var headers: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The list of custom patterns to delete. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/requestBody/json/patterns`. + public var patterns: [Components.Schemas.SecretScanningCustomPatternToDelete] + /// What to do with alerts associated with the deleted patterns. + /// `delete_alerts` permanently removes the alerts. + /// `resolve_alerts` resolves the alerts as "pattern deleted". + /// Defaults to `delete_alerts` when not specified. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/requestBody/json/post_delete_action`. + @frozen public enum PostDeleteActionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case deleteAlerts = "delete_alerts" + case resolveAlerts = "resolve_alerts" + } + /// What to do with alerts associated with the deleted patterns. + /// `delete_alerts` permanently removes the alerts. + /// `resolve_alerts` resolves the alerts as "pattern deleted". + /// Defaults to `delete_alerts` when not specified. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/requestBody/json/post_delete_action`. + public var postDeleteAction: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Body.JsonPayload.PostDeleteActionPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patterns: The list of custom patterns to delete. + /// - postDeleteAction: What to do with alerts associated with the deleted patterns. + public init( + patterns: [Components.Schemas.SecretScanningCustomPatternToDelete], + postDeleteAction: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Body.JsonPayload.PostDeleteActionPayload? = nil + ) { + self.patterns = patterns + self.postDeleteAction = postDeleteAction + } + public enum CodingKeys: String, CodingKey { + case patterns + case postDeleteAction = "post_delete_action" + } } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/DELETE/requestBody/content/application\/json`. + case json(Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Body.JsonPayload) } - public var headers: Operations.SecretScanningListAlertsForRepo.Input.Headers + public var body: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.SecretScanningListAlertsForRepo.Input.Path, - query: Operations.SecretScanningListAlertsForRepo.Input.Query = .init(), - headers: Operations.SecretScanningListAlertsForRepo.Input.Headers = .init() + path: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SecretScanningAlert]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SecretScanningAlert] { - get throws { - switch self { - case let .json(body): - return body - } - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// All patterns deleted successfully. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.SecretScanningBulkDeleteOrgCustomPatterns.Output.NoContent) + /// All patterns deleted successfully. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.SecretScanningBulkDeleteOrgCustomPatterns.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// Received HTTP response body - public var body: Operations.SecretScanningListAlertsForRepo.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.SecretScanningListAlertsForRepo.Output.Ok.Body) { - self.body = body - } } - /// Response + /// Bad Request /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)/responses/400`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningListAlertsForRepo.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SecretScanningListAlertsForRepo.Output.Ok { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { get throws { switch self { - case let .ok(response): + case let .badRequest(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "badRequest", response: self ) } } } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Repository is public or secret scanning is disabled for the repository + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)/responses/403`. /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.SecretScanningListAlertsForRepo.Output.NotFound) - /// Repository is public or secret scanning is disabled for the repository + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)/responses/404`. + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)/responses/404`. /// /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } + case notFound(Components.Responses.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SecretScanningListAlertsForRepo.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -4517,24 +5445,24 @@ public enum Operations { } } } - /// Service unavailable + /// Precondition Failed /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)/responses/503`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-org-custom-patterns)/responses/412`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `412 preconditionFailed`. + case preconditionFailed(Components.Responses.PreconditionFailed) + /// The associated value of the enum case if `self` is `.preconditionFailed`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.preconditionFailed`. + /// - SeeAlso: `.preconditionFailed`. + public var preconditionFailed: Components.Responses.PreconditionFailed { get throws { switch self { - case let .serviceUnavailable(response): + case let .preconditionFailed(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "preconditionFailed", response: self ) } @@ -4547,11 +5475,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -4562,113 +5493,98 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Get a secret scanning alert - /// - /// Gets a single secret scanning alert detected in an eligible repository. + /// Update an organization custom pattern /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Updates a secret scanning custom pattern for an organization. /// - /// 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. + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)`. - public enum SecretScanningGetAlert { - public static let id: Swift.String = "secret-scanning/get-alert" + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)`. + public enum SecretScanningUpdateOrgCustomPattern { + public static let id: Swift.String = "secret-scanning/update-org-custom-pattern" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/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}/secret-scanning/alerts/{alert_number}/GET/path/owner`. - public var owner: Components.Parameters.Owner - /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/path/repo`. - public var repo: Components.Parameters.Repo - /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/PATCH/path/org`. + public var org: Components.Parameters.Org + /// The ID of the custom pattern. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/path/alert_number`. - public var alertNumber: Components.Parameters.AlertNumber + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/PATCH/path/pattern_id`. + public var patternId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: - /// - owner: The account owner of the repository. The name is not case sensitive. - /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - alertNumber: The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// - org: The organization name. The name is not case sensitive. + /// - patternId: The ID of the custom pattern. public init( - owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - alertNumber: Components.Parameters.AlertNumber + org: Components.Parameters.Org, + patternId: Swift.Int ) { - self.owner = owner - self.repo = repo - self.alertNumber = alertNumber - } - } - public var path: Operations.SecretScanningGetAlert.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/query`. - public struct Query: Sendable, Hashable { - /// A boolean value representing whether or not to hide literal secrets in the results. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/query/hide_secret`. - public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. - public init(hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil) { - self.hideSecret = hideSecret + self.org = org + self.patternId = patternId } } - public var query: Operations.SecretScanningGetAlert.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/header`. + public var path: Operations.SecretScanningUpdateOrgCustomPattern.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SecretScanningGetAlert.Input.Headers + public var headers: Operations.SecretScanningUpdateOrgCustomPattern.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/PATCH/requestBody/content/application\/json`. + case json(Components.Schemas.SecretScanningCustomPatternToUpdate) + } + public var body: Operations.SecretScanningUpdateOrgCustomPattern.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.SecretScanningGetAlert.Input.Path, - query: Operations.SecretScanningGetAlert.Input.Query = .init(), - headers: Operations.SecretScanningGetAlert.Input.Headers = .init() + path: Operations.SecretScanningUpdateOrgCustomPattern.Input.Path, + headers: Operations.SecretScanningUpdateOrgCustomPattern.Input.Headers = .init(), + body: Operations.SecretScanningUpdateOrgCustomPattern.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.SecretScanningAlert) + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.SecretScanningCustomPattern) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.SecretScanningAlert { + public var json: Components.Schemas.SecretScanningCustomPattern { get throws { switch self { case let .json(body): @@ -4678,26 +5594,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SecretScanningGetAlert.Output.Ok.Body + public var body: Operations.SecretScanningUpdateOrgCustomPattern.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SecretScanningGetAlert.Output.Ok.Body) { + public init(body: Operations.SecretScanningUpdateOrgCustomPattern.Output.Ok.Body) { self.body = body } } - /// Response + /// Pattern updated successfully. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningGetAlert.Output.Ok) + case ok(Operations.SecretScanningUpdateOrgCustomPattern.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.SecretScanningGetAlert.Output.Ok { + public var ok: Operations.SecretScanningUpdateOrgCustomPattern.Output.Ok { get throws { switch self { case let .ok(response): @@ -4710,60 +5626,2528 @@ public enum Operations { } } } - /// Not modified - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/304`. - /// - /// HTTP response code: `304 notModified`. - case notModified(Components.Responses.NotModified) - /// Not modified + /// Bad Request /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/304`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)/responses/400`. /// - /// HTTP response code: `304 notModified`. - public static var notModified: Self { - .notModified(.init()) - } - /// The associated value of the enum case if `self` is `.notModified`. + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. /// - /// - Throws: An error if `self` is not `.notModified`. - /// - SeeAlso: `.notModified`. - public var notModified: Components.Responses.NotModified { - get throws { + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Precondition Failed + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)/responses/412`. + /// + /// HTTP response code: `412 preconditionFailed`. + case preconditionFailed(Components.Responses.PreconditionFailed) + /// The associated value of the enum case if `self` is `.preconditionFailed`. + /// + /// - Throws: An error if `self` is not `.preconditionFailed`. + /// - SeeAlso: `.preconditionFailed`. + public var preconditionFailed: Components.Responses.PreconditionFailed { + get throws { + switch self { + case let .preconditionFailed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "preconditionFailed", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-org-custom-pattern)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// List organization pattern configurations + /// + /// Lists the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)`. + public enum SecretScanningListOrgPatternConfigs { + public static let id: Swift.String = "secret-scanning/list-org-pattern-configs" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.SecretScanningListOrgPatternConfigs.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/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.SecretScanningListOrgPatternConfigs.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.SecretScanningListOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningListOrgPatternConfigs.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SecretScanningPatternConfiguration) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SecretScanningPatternConfiguration { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningListOrgPatternConfigs.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningListOrgPatternConfigs.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.SecretScanningListOrgPatternConfigs.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/get(secret-scanning/list-org-pattern-configs)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update organization pattern configurations + /// + /// Updates the secret scanning pattern configurations for an organization. + /// + /// Personal access tokens (classic) need the `write:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PATCH /orgs/{org}/secret-scanning/pattern-configurations`. + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)`. + public enum SecretScanningUpdateOrgPatternConfigs { + public static let id: Swift.String = "secret-scanning/update-org-pattern-configs" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/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.SecretScanningUpdateOrgPatternConfigs.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/pattern_config_version`. + public var patternConfigVersion: Components.Schemas.SecretScanningRowVersion? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload`. + public struct ProviderPatternSettingsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the pattern to configure. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/token_type`. + public var tokenType: Swift.String? + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. + @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case notSet = "not-set" + case disabled = "disabled" + case enabled = "enabled" + } + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/ProviderPatternSettingsPayload/push_protection_setting`. + public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? + /// Creates a new `ProviderPatternSettingsPayloadPayload`. + /// + /// - Parameters: + /// - tokenType: The ID of the pattern to configure. + /// - pushProtectionSetting: Push protection setting to set for the pattern. + public init( + tokenType: Swift.String? = nil, + pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil + ) { + self.tokenType = tokenType + self.pushProtectionSetting = pushProtectionSetting + } + public enum CodingKeys: String, CodingKey { + case tokenType = "token_type" + case pushProtectionSetting = "push_protection_setting" + } + } + /// Pattern settings for provider patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. + public typealias ProviderPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayloadPayload] + /// Pattern settings for provider patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/provider_pattern_settings`. + public var providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload`. + public struct CustomPatternSettingsPayloadPayload: Codable, Hashable, Sendable { + /// The ID of the pattern to configure. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/token_type`. + public var tokenType: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/custom_pattern_version`. + public var customPatternVersion: Components.Schemas.SecretScanningRowVersion? + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. + @frozen public enum PushProtectionSettingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case enabled = "enabled" + } + /// Push protection setting to set for the pattern. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/CustomPatternSettingsPayload/push_protection_setting`. + public var pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? + /// Creates a new `CustomPatternSettingsPayloadPayload`. + /// + /// - Parameters: + /// - tokenType: The ID of the pattern to configure. + /// - customPatternVersion: + /// - pushProtectionSetting: Push protection setting to set for the pattern. + public init( + tokenType: Swift.String? = nil, + customPatternVersion: Components.Schemas.SecretScanningRowVersion? = nil, + pushProtectionSetting: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload.PushProtectionSettingPayload? = nil + ) { + self.tokenType = tokenType + self.customPatternVersion = customPatternVersion + self.pushProtectionSetting = pushProtectionSetting + } + public enum CodingKeys: String, CodingKey { + case tokenType = "token_type" + case customPatternVersion = "custom_pattern_version" + case pushProtectionSetting = "push_protection_setting" + } + } + /// Pattern settings for custom patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. + public typealias CustomPatternSettingsPayload = [Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayloadPayload] + /// Pattern settings for custom patterns. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/json/custom_pattern_settings`. + public var customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patternConfigVersion: + /// - providerPatternSettings: Pattern settings for provider patterns. + /// - customPatternSettings: Pattern settings for custom patterns. + public init( + patternConfigVersion: Components.Schemas.SecretScanningRowVersion? = nil, + providerPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.ProviderPatternSettingsPayload? = nil, + customPatternSettings: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload.CustomPatternSettingsPayload? = nil + ) { + self.patternConfigVersion = patternConfigVersion + self.providerPatternSettings = providerPatternSettings + self.customPatternSettings = customPatternSettings + } + public enum CodingKeys: String, CodingKey { + case patternConfigVersion = "pattern_config_version" + case providerPatternSettings = "provider_pattern_settings" + case customPatternSettings = "custom_pattern_settings" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/requestBody/content/application\/json`. + case json(Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body.JsonPayload) + } + public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Path, + headers: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Headers = .init(), + body: Operations.SecretScanningUpdateOrgPatternConfigs.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The updated pattern configuration version. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/json/pattern_config_version`. + public var patternConfigVersion: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patternConfigVersion: The updated pattern configuration version. + public init(patternConfigVersion: Swift.String? = nil) { + self.patternConfigVersion = patternConfigVersion + } + public enum CodingKeys: String, CodingKey { + case patternConfigVersion = "pattern_config_version" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/secret-scanning/pattern-configurations/PATCH/responses/200/content/application\/json`. + case json(Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningUpdateOrgPatternConfigs.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningUpdateOrgPatternConfigs.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.SecretScanningUpdateOrgPatternConfigs.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Components.Responses.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Components.Responses.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/secret-scanning/pattern-configurations/patch(secret-scanning/update-org-pattern-configs)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case applicationScimJson + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "application/scim+json": + self = .applicationScimJson + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .applicationScimJson: + return "application/scim+json" + } + } + public static var allCases: [Self] { + [ + .json, + .applicationScimJson + ] + } + } + } + /// List secret scanning alerts for a repository + /// + /// Lists secret scanning alerts for an eligible repository, from newest to oldest. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)`. + public enum SecretScanningListAlertsForRepo { + public static let id: Swift.String = "secret-scanning/list-alerts-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/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/alerts/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/alerts/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.SecretScanningListAlertsForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-state`. + @frozen public enum SecretScanningAlertState: String, Codable, Hashable, Sendable, CaseIterable { + case open = "open" + case resolved = "resolved" + } + /// Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/state`. + public var state: Components.Parameters.SecretScanningAlertState? + /// A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/secret_type`. + public var secretType: Components.Parameters.SecretScanningAlertSecretType? + /// A comma-separated list of secret types to exclude from the results. All default secret patterns are returned except those matching the specified types. Cannot be combined with the `secret_type` parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/exclude_secret_types`. + public var excludeSecretTypes: Components.Parameters.SecretScanningAlertExcludeSecretTypes? + /// A comma-separated list of provider slugs to exclude from the results. + /// Provider slugs use lowercase with underscores (e.g., `github_secret_scanning`, `clojars`). + /// You can find the provider slug in the `provider_slug` field of each alert. + /// Cannot be combined with the `providers` parameter. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/exclude_providers`. + public var excludeProviders: Components.Parameters.SecretScanningAlertExcludeProviders? + /// A comma-separated list of provider slugs to filter by. + /// Provider slugs use lowercase with underscores (e.g., `github_secret_scanning`, `clojars`). + /// You can find the provider slug in the `provider_slug` field of each alert. + /// Cannot be combined with the `exclude_providers` parameter. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/providers`. + public var providers: Components.Parameters.SecretScanningAlertProviders? + /// A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/resolution`. + public var resolution: Components.Parameters.SecretScanningAlertResolution? + /// Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/assignee`. + public var assignee: Components.Parameters.SecretScanningAlertAssignee? + /// - Remark: Generated from `#/components/parameters/secret-scanning-alert-sort`. + @frozen public enum SecretScanningAlertSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + } + /// The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/sort`. + public var sort: Components.Parameters.SecretScanningAlertSort? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// 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}/secret-scanning/alerts/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/before`. + public var before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? + /// A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/after`. + public var after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? + /// A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/validity`. + public var validity: Components.Parameters.SecretScanningAlertValidity? + /// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_publicly_leaked`. + public var isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? + /// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_multi_repo`. + public var isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? + /// A boolean value representing whether or not to hide literal secrets in the results. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/hide_secret`. + public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? + /// A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/is_bypassed`. + public var isBypassed: Components.Parameters.SecretScanningAlertBypassed? + /// A comma-separated list of metadata fields to filter alerts by. Only alerts that have all of the + /// specified metadata fields attached will be returned. Possible values are: `owner-email`, `owner-id`, + /// `owner-name`, `secret-id`, `secret-name`, `secret-issued-date`, `secret-expiration-date`, `organization-name`, + /// `organization-id`, `last-used-date`, and `has-organization-access`. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/included_metadata`. + public var includedMetadata: Components.Parameters.SecretScanningAlertIncludedMetadata? + /// Filters alerts to only those whose attached `owner_email` metadata field matches the + /// provided value. The value must be the lowercase hex-encoded SHA-256 hash of the email + /// address to match (for example, the SHA-256 of `user@example.com`). Only alerts that + /// have an `owner_email` metadata value whose SHA-256 hash equals this parameter are + /// returned. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/query/owner_email_hash`. + public var ownerEmailHash: Components.Parameters.SecretScanningAlertOwnerEmailHash? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + /// - secretType: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. + /// - excludeSecretTypes: A comma-separated list of secret types to exclude from the results. All default secret patterns are returned except those matching the specified types. Cannot be combined with the `secret_type` parameter. See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. + /// - excludeProviders: A comma-separated list of provider slugs to exclude from the results. + /// - providers: A comma-separated list of provider slugs to filter by. + /// - resolution: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. + /// - assignee: Filters alerts by assignee. Use `*` to get all assigned alerts, `none` to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user. + /// - sort: The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. + /// - direction: The direction to sort the results by. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - before: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + /// - validity: A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + /// - isPubliclyLeaked: A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. + /// - isMultiRepo: A boolean value representing whether or not to filter alerts by the multi-repo tag being present. + /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. + /// - isBypassed: A boolean value (`true` or `false`) indicating whether to filter alerts by their push protection bypass status. When set to `true`, only alerts that were created because a push protection rule was bypassed will be returned. When set to `false`, only alerts that were not caused by a push protection bypass will be returned. + /// - includedMetadata: A comma-separated list of metadata fields to filter alerts by. Only alerts that have all of the + /// - ownerEmailHash: Filters alerts to only those whose attached `owner_email` metadata field matches the + public init( + state: Components.Parameters.SecretScanningAlertState? = nil, + secretType: Components.Parameters.SecretScanningAlertSecretType? = nil, + excludeSecretTypes: Components.Parameters.SecretScanningAlertExcludeSecretTypes? = nil, + excludeProviders: Components.Parameters.SecretScanningAlertExcludeProviders? = nil, + providers: Components.Parameters.SecretScanningAlertProviders? = nil, + resolution: Components.Parameters.SecretScanningAlertResolution? = nil, + assignee: Components.Parameters.SecretScanningAlertAssignee? = nil, + sort: Components.Parameters.SecretScanningAlertSort? = nil, + direction: Components.Parameters.Direction? = nil, + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil, + before: Components.Parameters.SecretScanningPaginationBeforeOrgRepo? = nil, + after: Components.Parameters.SecretScanningPaginationAfterOrgRepo? = nil, + validity: Components.Parameters.SecretScanningAlertValidity? = nil, + isPubliclyLeaked: Components.Parameters.SecretScanningAlertPubliclyLeaked? = nil, + isMultiRepo: Components.Parameters.SecretScanningAlertMultiRepo? = nil, + hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil, + isBypassed: Components.Parameters.SecretScanningAlertBypassed? = nil, + includedMetadata: Components.Parameters.SecretScanningAlertIncludedMetadata? = nil, + ownerEmailHash: Components.Parameters.SecretScanningAlertOwnerEmailHash? = nil + ) { + self.state = state + self.secretType = secretType + self.excludeSecretTypes = excludeSecretTypes + self.excludeProviders = excludeProviders + self.providers = providers + self.resolution = resolution + self.assignee = assignee + self.sort = sort + self.direction = direction + self.page = page + self.perPage = perPage + self.before = before + self.after = after + self.validity = validity + self.isPubliclyLeaked = isPubliclyLeaked + self.isMultiRepo = isMultiRepo + self.hideSecret = hideSecret + self.isBypassed = isBypassed + self.includedMetadata = includedMetadata + self.ownerEmailHash = ownerEmailHash + } + } + public var query: Operations.SecretScanningListAlertsForRepo.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.SecretScanningListAlertsForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.SecretScanningListAlertsForRepo.Input.Path, + query: Operations.SecretScanningListAlertsForRepo.Input.Query = .init(), + headers: Operations.SecretScanningListAlertsForRepo.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}/secret-scanning/alerts/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SecretScanningAlert]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SecretScanningAlert] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningListAlertsForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningListAlertsForRepo.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningListAlertsForRepo.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.SecretScanningListAlertsForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Repository is public or secret scanning is disabled for the repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.SecretScanningListAlertsForRepo.Output.NotFound) + /// Repository is public or secret scanning is disabled for the repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/get(secret-scanning/list-alerts-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.SecretScanningListAlertsForRepo.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/alerts/get(secret-scanning/list-alerts-for-repo)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get a secret scanning alert + /// + /// Gets a single secret scanning alert detected in an eligible repository. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)`. + public enum SecretScanningGetAlert { + public static let id: Swift.String = "secret-scanning/get-alert" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/path/alert_number`. + public var alertNumber: Components.Parameters.AlertNumber + /// 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. + /// - alertNumber: The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + alertNumber: Components.Parameters.AlertNumber + ) { + self.owner = owner + self.repo = repo + self.alertNumber = alertNumber + } + } + public var path: Operations.SecretScanningGetAlert.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/query`. + public struct Query: Sendable, Hashable { + /// A boolean value representing whether or not to hide literal secrets in the results. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/query/hide_secret`. + public var hideSecret: Components.Parameters.SecretScanningAlertHideSecret? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - hideSecret: A boolean value representing whether or not to hide literal secrets in the results. + public init(hideSecret: Components.Parameters.SecretScanningAlertHideSecret? = nil) { + self.hideSecret = hideSecret + } + } + public var query: Operations.SecretScanningGetAlert.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.SecretScanningGetAlert.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.SecretScanningGetAlert.Input.Path, + query: Operations.SecretScanningGetAlert.Input.Query = .init(), + headers: Operations.SecretScanningGetAlert.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}/secret-scanning/alerts/{alert_number}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.SecretScanningAlertWithMetadata) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SecretScanningAlertWithMetadata { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningGetAlert.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningGetAlert.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningGetAlert.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.SecretScanningGetAlert.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + case notModified(Components.Responses.NotModified) + /// Not modified + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/304`. + /// + /// HTTP response code: `304 notModified`. + public static var notModified: Self { + .notModified(.init()) + } + /// The associated value of the enum case if `self` is `.notModified`. + /// + /// - Throws: An error if `self` is not `.notModified`. + /// - SeeAlso: `.notModified`. + public var notModified: Components.Responses.NotModified { + get throws { + switch self { + case let .notModified(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notModified", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.SecretScanningGetAlert.Output.NotFound) + /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.SecretScanningGetAlert.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/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update a secret scanning alert + /// + /// Updates the status of a secret scanning alert in an eligible repository. + /// + /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)`. + public enum SecretScanningUpdateAlert { + public static let id: Swift.String = "secret-scanning/update-alert" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/path/alert_number`. + public var alertNumber: Components.Parameters.AlertNumber + /// 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. + /// - alertNumber: The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + alertNumber: Components.Parameters.AlertNumber + ) { + self.owner = owner + self.repo = repo + self.alertNumber = alertNumber + } + } + public var path: Operations.SecretScanningUpdateAlert.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.SecretScanningUpdateAlert.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Creates a new `Value1Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. + public var value1: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Creates a new `Value2Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. + public var value2: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value3`. + public struct Value3Payload: Codable, Hashable, Sendable { + /// Creates a new `Value3Payload`. + public init() {} + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value3`. + public var value3: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value3Payload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + /// - value3: + public init( + value1: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? = nil, + value2: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? = nil, + value3: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value3Payload? = nil + ) { + self.value1 = value1 + self.value2 = value2 + self.value3 = value3 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value3 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2, + self.value3 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + try self.value3?.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/content/application\/json`. + case json(Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload) + } + public var body: Operations.SecretScanningUpdateAlert.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.SecretScanningUpdateAlert.Input.Path, + headers: Operations.SecretScanningUpdateAlert.Input.Headers = .init(), + body: Operations.SecretScanningUpdateAlert.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}/secret-scanning/alerts/{alert_number}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.SecretScanningAlertWithMetadata) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SecretScanningAlertWithMetadata { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningUpdateAlert.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningUpdateAlert.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningUpdateAlert.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.SecretScanningUpdateAlert.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// Creates a new `BadRequest`. + public init() {} + } + /// Bad request, resolution comment is invalid or the resolution was not changed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.SecretScanningUpdateAlert.Output.BadRequest) + /// Bad request, resolution comment is invalid or the resolution was not changed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + public static var badRequest: Self { + .badRequest(.init()) + } + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.SecretScanningUpdateAlert.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// Creates a new `Forbidden`. + public init() {} + } + /// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.SecretScanningUpdateAlert.Output.Forbidden) + /// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + public static var forbidden: Self { + .forbidden(.init()) + } + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Operations.SecretScanningUpdateAlert.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.SecretScanningUpdateAlert.Output.NotFound) + /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.SecretScanningUpdateAlert.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// State does not match the resolution or resolution comment, assignee does not have write access to the repository, or the requested validity change could not be applied to this alert + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.SecretScanningUpdateAlert.Output.UnprocessableContent) + /// State does not match the resolution or resolution comment, assignee does not have write access to the repository, or the requested validity change could not be applied to this alert + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + public static var unprocessableContent: Self { + .unprocessableContent(.init()) + } + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.SecretScanningUpdateAlert.Output.UnprocessableContent { + 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}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case 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 locations for a secret scanning alert + /// + /// Lists all locations for a given secret scanning alert for an eligible repository. + /// + /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)`. + public enum SecretScanningListLocationsForAlert { + public static let id: Swift.String = "secret-scanning/list-locations-for-alert" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/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/alerts/{alert_number}/locations/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/alerts/{alert_number}/locations/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/path/alert_number`. + public var alertNumber: Components.Parameters.AlertNumber + /// 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. + /// - alertNumber: The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo, + alertNumber: Components.Parameters.AlertNumber + ) { + self.owner = owner + self.repo = repo + self.alertNumber = alertNumber + } + } + public var path: Operations.SecretScanningListLocationsForAlert.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.SecretScanningListLocationsForAlert.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/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.SecretScanningListLocationsForAlert.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.SecretScanningListLocationsForAlert.Input.Path, + query: Operations.SecretScanningListLocationsForAlert.Input.Query = .init(), + headers: Operations.SecretScanningListLocationsForAlert.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}/secret-scanning/alerts/{alert_number}/locations/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/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.SecretScanningListLocationsForAlert.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SecretScanningLocation]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SecretScanningLocation] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningListLocationsForAlert.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.SecretScanningListLocationsForAlert.Output.Ok.Headers = .init(), + body: Operations.SecretScanningListLocationsForAlert.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningListLocationsForAlert.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.SecretScanningListLocationsForAlert.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// Creates a new `NotFound`. + public init() {} + } + /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.SecretScanningListLocationsForAlert.Output.NotFound) + /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + public static var notFound: Self { + .notFound(.init()) + } + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.SecretScanningListLocationsForAlert.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/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// List repository custom patterns + /// + /// Lists secret scanning custom patterns 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/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/get(secret-scanning/list-repo-custom-patterns)`. + public enum SecretScanningListRepoCustomPatterns { + public static let id: Swift.String = "secret-scanning/list-repo-custom-patterns" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/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/custom-patterns/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/custom-patterns/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.SecretScanningListRepoCustomPatterns.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-state`. + @frozen public enum SecretScanningCustomPatternState: String, Codable, Hashable, Sendable, CaseIterable { + case published = "published" + case unpublished = "unpublished" + } + /// Filter custom patterns by state. When absent, returns patterns in all states. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/query/state`. + public var state: Components.Parameters.SecretScanningCustomPatternState? + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-push-protection`. + @frozen public enum SecretScanningCustomPatternPushProtection: String, Codable, Hashable, Sendable, CaseIterable { + case enabled = "enabled" + case disabled = "disabled" + } + /// Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/query/push_protection`. + public var pushProtection: Components.Parameters.SecretScanningCustomPatternPushProtection? + /// - Remark: Generated from `#/components/parameters/secret-scanning-custom-pattern-sort`. + @frozen public enum SecretScanningCustomPatternSort: String, Codable, Hashable, Sendable, CaseIterable { + case created = "created" + case updated = "updated" + case name = "name" + } + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/query/sort`. + public var sort: Components.Parameters.SecretScanningCustomPatternSort? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/query/direction`. + public var direction: Components.Parameters.Direction? + /// 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}/secret-scanning/custom-patterns/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/query/per_page`. + public var perPage: Components.Parameters.PerPage? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - state: Filter custom patterns by state. When absent, returns patterns in all states. + /// - pushProtection: Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status. + /// - sort: The property to sort the results by. + /// - direction: The direction to sort the results by. + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + state: Components.Parameters.SecretScanningCustomPatternState? = nil, + pushProtection: Components.Parameters.SecretScanningCustomPatternPushProtection? = nil, + sort: Components.Parameters.SecretScanningCustomPatternSort? = nil, + direction: Components.Parameters.Direction? = nil, + page: Components.Parameters.Page? = nil, + perPage: Components.Parameters.PerPage? = nil + ) { + self.state = state + self.pushProtection = pushProtection + self.sort = sort + self.direction = direction + self.page = page + self.perPage = perPage + } + } + public var query: Operations.SecretScanningListRepoCustomPatterns.Input.Query + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/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.SecretScanningListRepoCustomPatterns.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.SecretScanningListRepoCustomPatterns.Input.Path, + query: Operations.SecretScanningListRepoCustomPatterns.Input.Query = .init(), + headers: Operations.SecretScanningListRepoCustomPatterns.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}/secret-scanning/custom-patterns/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/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.SecretScanningListRepoCustomPatterns.Output.Ok.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SecretScanningCustomPattern]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SecretScanningCustomPattern] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningListRepoCustomPatterns.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.SecretScanningListRepoCustomPatterns.Output.Ok.Headers = .init(), + body: Operations.SecretScanningListRepoCustomPatterns.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/get(secret-scanning/list-repo-custom-patterns)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.SecretScanningListRepoCustomPatterns.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.SecretScanningListRepoCustomPatterns.Output.Ok { + get throws { switch self { - case let .notModified(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notModified", + expectedStatus: "ok", response: self ) } } } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/get(secret-scanning/list-repo-custom-patterns)/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}/secret-scanning/custom-patterns/get(secret-scanning/list-repo-custom-patterns)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Bulk create repository custom patterns + /// + /// Bulk creates secret scanning custom patterns 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 `POST /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)`. + public enum SecretScanningBulkCreateRepoCustomPatterns { + public static let id: Swift.String = "secret-scanning/bulk-create-repo-custom-patterns" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/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}/secret-scanning/custom-patterns/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}/secret-scanning/custom-patterns/POST/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/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.SecretScanningBulkCreateRepoCustomPatterns.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The list of custom patterns to create. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/requestBody/json/patterns`. + public var patterns: [Components.Schemas.SecretScanningCustomPatternToCreate] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - patterns: The list of custom patterns to create. + public init(patterns: [Components.Schemas.SecretScanningCustomPatternToCreate]) { + self.patterns = patterns + } + public enum CodingKeys: String, CodingKey { + case patterns + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/requestBody/content/application\/json`. + case json(Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Body.JsonPayload) + } + public var body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkCreateRepoCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkCreateRepoCustomPatterns.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}/secret-scanning/custom-patterns/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The list of successfully created custom patterns. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/201/content/json/created_patterns`. + public var createdPatterns: [Components.Schemas.SecretScanningCustomPattern]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - createdPatterns: The list of successfully created custom patterns. + public init(createdPatterns: [Components.Schemas.SecretScanningCustomPattern]? = nil) { + self.createdPatterns = createdPatterns + } + public enum CodingKeys: String, CodingKey { + case createdPatterns = "created_patterns" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/201/content/application\/json`. + case json(Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.Created.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.Created.Body) { + self.body = body + } + } + /// All patterns created successfully. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.SecretScanningBulkCreateRepoCustomPatterns.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.SecretScanningBulkCreateRepoCustomPatterns.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)/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 + ) + } + } } - /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.SecretScanningGetAlert.Output.NotFound) - /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)/responses/404`. /// /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } + case notFound(Components.Responses.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SecretScanningGetAlert.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -4776,24 +8160,116 @@ public enum Operations { } } } - /// Service unavailable + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// A summary message describing the error. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content/json/message`. + public var message: Swift.String? + /// A map of validation errors keyed by the zero-based index of the pattern that failed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors`. + public struct ValidationErrorsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors/additionalProperties`. + public struct AdditionalPropertiesPayload: Codable, Hashable, Sendable { + /// List of validation errors for this pattern. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors/additionalProperties/errors`. + public var errors: [Components.Schemas.SecretScanningCustomPatternValidationError]? + /// Creates a new `AdditionalPropertiesPayload`. + /// + /// - Parameters: + /// - errors: List of validation errors for this pattern. + public init(errors: [Components.Schemas.SecretScanningCustomPatternValidationError]? = nil) { + self.errors = errors + } + public enum CodingKeys: String, CodingKey { + case errors + } + } + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload.AdditionalPropertiesPayload] + /// Creates a new `ValidationErrorsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload.AdditionalPropertiesPayload] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// A map of validation errors keyed by the zero-based index of the pattern that failed. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content/json/validation_errors`. + public var validationErrors: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: A summary message describing the error. + /// - validationErrors: A map of validation errors keyed by the zero-based index of the pattern that failed. + public init( + message: Swift.String? = nil, + validationErrors: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body.JsonPayload.ValidationErrorsPayload? = nil + ) { + self.message = message + self.validationErrors = validationErrors + } + public enum CodingKeys: String, CodingKey { + case message + case validationErrors = "validation_errors" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/POST/responses/422/content/application\/json`. + case json(Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation failed for one or more patterns. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/get(secret-scanning/get-alert)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/post(secret-scanning/bulk-create-repo-custom-patterns)/responses/422`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.SecretScanningBulkCreateRepoCustomPatterns.Output.UnprocessableContent { get throws { switch self { - case let .serviceUnavailable(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "unprocessableContent", response: self ) } @@ -4806,11 +8282,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -4821,151 +8300,111 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// Update a secret scanning alert - /// - /// Updates the status of a secret scanning alert in an eligible repository. - /// - /// You can also use this endpoint to assign or unassign an alert to a user who has write access to the repository. + /// Bulk delete repository custom patterns /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Bulk deletes secret scanning custom patterns 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 `PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)`. - public enum SecretScanningUpdateAlert { - public static let id: Swift.String = "secret-scanning/update-alert" + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/secret-scanning/custom-patterns`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)`. + public enum SecretScanningBulkDeleteRepoCustomPatterns { + public static let id: Swift.String = "secret-scanning/bulk-delete-repo-custom-patterns" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/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}/secret-scanning/alerts/{alert_number}/PATCH/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/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}/secret-scanning/alerts/{alert_number}/PATCH/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/path/alert_number`. - public var alertNumber: Components.Parameters.AlertNumber /// 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. - /// - alertNumber: The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. public init( owner: Components.Parameters.Owner, - repo: Components.Parameters.Repo, - alertNumber: Components.Parameters.AlertNumber + repo: Components.Parameters.Repo ) { self.owner = owner self.repo = repo - self.alertNumber = alertNumber } } - public var path: Operations.SecretScanningUpdateAlert.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/header`. + public var path: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SecretScanningUpdateAlert.Input.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody`. + public var headers: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. - public struct Value1Payload: Codable, Hashable, Sendable { - /// Creates a new `Value1Payload`. - public init() {} - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value1`. - public var value1: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. - public struct Value2Payload: Codable, Hashable, Sendable { - /// Creates a new `Value2Payload`. - public init() {} - } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value2`. - public var value2: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value3`. - public struct Value3Payload: Codable, Hashable, Sendable { - /// Creates a new `Value3Payload`. - public init() {} + /// The list of custom patterns to delete. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/requestBody/json/patterns`. + public var patterns: [Components.Schemas.SecretScanningCustomPatternToDelete] + /// What to do with alerts associated with the deleted patterns. + /// `delete_alerts` permanently removes the alerts. + /// `resolve_alerts` resolves the alerts as "pattern deleted". + /// Defaults to `delete_alerts` when not specified. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/requestBody/json/post_delete_action`. + @frozen public enum PostDeleteActionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case deleteAlerts = "delete_alerts" + case resolveAlerts = "resolve_alerts" } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/json/value3`. - public var value3: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value3Payload? + /// What to do with alerts associated with the deleted patterns. + /// `delete_alerts` permanently removes the alerts. + /// `resolve_alerts` resolves the alerts as "pattern deleted". + /// Defaults to `delete_alerts` when not specified. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/requestBody/json/post_delete_action`. + public var postDeleteAction: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Body.JsonPayload.PostDeleteActionPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - value1: - /// - value2: - /// - value3: + /// - patterns: The list of custom patterns to delete. + /// - postDeleteAction: What to do with alerts associated with the deleted patterns. public init( - value1: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value1Payload? = nil, - value2: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value2Payload? = nil, - value3: Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload.Value3Payload? = nil + patterns: [Components.Schemas.SecretScanningCustomPatternToDelete], + postDeleteAction: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Body.JsonPayload.PostDeleteActionPayload? = nil ) { - self.value1 = value1 - self.value2 = value2 - self.value3 = value3 - } - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self.value1 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value2 = try .init(from: decoder) - } catch { - errors.append(error) - } - do { - self.value3 = try .init(from: decoder) - } catch { - errors.append(error) - } - try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( - [ - self.value1, - self.value2, - self.value3 - ], - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) + self.patterns = patterns + self.postDeleteAction = postDeleteAction } - public func encode(to encoder: any Swift.Encoder) throws { - try self.value1?.encode(to: encoder) - try self.value2?.encode(to: encoder) - try self.value3?.encode(to: encoder) + public enum CodingKeys: String, CodingKey { + case patterns + case postDeleteAction = "post_delete_action" } } - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/requestBody/content/application\/json`. - case json(Operations.SecretScanningUpdateAlert.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/DELETE/requestBody/content/application\/json`. + case json(Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Body.JsonPayload) } - public var body: Operations.SecretScanningUpdateAlert.Input.Body + public var body: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -4973,9 +8412,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.SecretScanningUpdateAlert.Input.Path, - headers: Operations.SecretScanningUpdateAlert.Input.Headers = .init(), - body: Operations.SecretScanningUpdateAlert.Input.Body + path: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Path, + headers: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Headers = .init(), + body: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Input.Body ) { self.path = path self.headers = headers @@ -4983,80 +8422,52 @@ public enum Operations { } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.SecretScanningAlert) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.SecretScanningAlert { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.SecretScanningUpdateAlert.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.SecretScanningUpdateAlert.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Response + /// All patterns deleted successfully. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningUpdateAlert.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.SecretScanningBulkDeleteRepoCustomPatterns.Output.NoContent) + /// All patterns deleted successfully. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SecretScanningUpdateAlert.Output.Ok { + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.SecretScanningBulkDeleteRepoCustomPatterns.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } - public struct BadRequest: Sendable, Hashable { - /// Creates a new `BadRequest`. - public init() {} - } - /// Bad request, resolution comment is invalid or the resolution was not changed. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/400`. - /// - /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SecretScanningUpdateAlert.Output.BadRequest) - /// Bad request, resolution comment is invalid or the resolution was not changed. + /// Bad Request /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/400`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)/responses/400`. /// /// HTTP response code: `400 badRequest`. - public static var badRequest: Self { - .badRequest(.init()) - } + case badRequest(Components.Responses.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SecretScanningUpdateAlert.Output.BadRequest { + public var badRequest: Components.Responses.BadRequest { get throws { switch self { case let .badRequest(response): @@ -5069,29 +8480,17 @@ public enum Operations { } } } - public struct Forbidden: Sendable, Hashable { - /// Creates a new `Forbidden`. - public init() {} - } - /// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer. - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/403`. - /// - /// HTTP response code: `403 forbidden`. - case forbidden(Operations.SecretScanningUpdateAlert.Output.Forbidden) - /// Delegated alert dismissal is enabled and the authenticated user is not a valid reviewer. + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/403`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)/responses/403`. /// /// HTTP response code: `403 forbidden`. - public static var forbidden: Self { - .forbidden(.init()) - } + case forbidden(Components.Responses.Forbidden) /// The associated value of the enum case if `self` is `.forbidden`. /// /// - Throws: An error if `self` is not `.forbidden`. /// - SeeAlso: `.forbidden`. - public var forbidden: Operations.SecretScanningUpdateAlert.Output.Forbidden { + public var forbidden: Components.Responses.Forbidden { get throws { switch self { case let .forbidden(response): @@ -5104,29 +8503,17 @@ public enum Operations { } } } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} - } - /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/404`. - /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.SecretScanningUpdateAlert.Output.NotFound) - /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// Resource not found /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)/responses/404`. /// /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } + case notFound(Components.Responses.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SecretScanningUpdateAlert.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -5139,59 +8526,24 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// State does not match the resolution or resolution comment, assignee does not have write access to the repository, or the requested validity change could not be applied to this alert - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.SecretScanningUpdateAlert.Output.UnprocessableContent) - /// State does not match the resolution or resolution comment, assignee does not have write access to the repository, or the requested validity change could not be applied to this alert - /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - public static var unprocessableContent: Self { - .unprocessableContent(.init()) - } - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.SecretScanningUpdateAlert.Output.UnprocessableContent { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } - /// Service unavailable + /// Precondition Failed /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/patch(secret-scanning/update-alert)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/delete(secret-scanning/bulk-delete-repo-custom-patterns)/responses/412`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `412 preconditionFailed`. + case preconditionFailed(Components.Responses.PreconditionFailed) + /// The associated value of the enum case if `self` is `.preconditionFailed`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.preconditionFailed`. + /// - SeeAlso: `.preconditionFailed`. + public var preconditionFailed: Components.Responses.PreconditionFailed { get throws { switch self { - case let .serviceUnavailable(response): + case let .preconditionFailed(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "preconditionFailed", response: self ) } @@ -5204,11 +8556,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -5219,136 +8574,105 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } } - /// List locations for a secret scanning alert + /// Update a repository custom pattern /// - /// Lists all locations for a given secret scanning alert for an eligible repository. - /// - /// The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint. + /// Updates a secret scanning custom pattern 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/alerts/{alert_number}/locations`. - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)`. - public enum SecretScanningListLocationsForAlert { - public static let id: Swift.String = "secret-scanning/list-locations-for-alert" + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)`. + public enum SecretScanningUpdateRepoCustomPattern { + public static let id: Swift.String = "secret-scanning/update-repo-custom-pattern" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/path`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/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}/secret-scanning/alerts/{alert_number}/locations/GET/path/owner`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/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}/secret-scanning/alerts/{alert_number}/locations/GET/path/repo`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/PATCH/path/repo`. public var repo: Components.Parameters.Repo - /// The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// The ID of the custom pattern. /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/path/alert_number`. - public var alertNumber: Components.Parameters.AlertNumber + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/PATCH/path/pattern_id`. + public var patternId: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - owner: The account owner of the repository. The name is not case sensitive. /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. - /// - alertNumber: The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. + /// - patternId: The ID of the custom pattern. public init( owner: Components.Parameters.Owner, repo: Components.Parameters.Repo, - alertNumber: Components.Parameters.AlertNumber + patternId: Swift.Int ) { self.owner = owner self.repo = repo - self.alertNumber = alertNumber - } - } - public var path: Operations.SecretScanningListLocationsForAlert.Input.Path - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/query`. - public struct Query: Sendable, Hashable { - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/query/per_page`. - public var perPage: Components.Parameters.PerPage? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - public init( - page: Components.Parameters.Page? = nil, - perPage: Components.Parameters.PerPage? = nil - ) { - self.page = page - self.perPage = perPage + self.patternId = patternId } } - public var query: Operations.SecretScanningListLocationsForAlert.Input.Query - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/header`. + public var path: Operations.SecretScanningUpdateRepoCustomPattern.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SecretScanningListLocationsForAlert.Input.Headers + public var headers: Operations.SecretScanningUpdateRepoCustomPattern.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/PATCH/requestBody/content/application\/json`. + case json(Components.Schemas.SecretScanningCustomPatternToUpdate) + } + public var body: Operations.SecretScanningUpdateRepoCustomPattern.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.SecretScanningListLocationsForAlert.Input.Path, - query: Operations.SecretScanningListLocationsForAlert.Input.Query = .init(), - headers: Operations.SecretScanningListLocationsForAlert.Input.Headers = .init() + path: Operations.SecretScanningUpdateRepoCustomPattern.Input.Path, + headers: Operations.SecretScanningUpdateRepoCustomPattern.Input.Headers = .init(), + body: Operations.SecretScanningUpdateRepoCustomPattern.Input.Body ) { self.path = path - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/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.SecretScanningListLocationsForAlert.Output.Ok.Headers - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SecretScanningLocation]) + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.SecretScanningCustomPattern) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SecretScanningLocation] { + public var json: Components.Schemas.SecretScanningCustomPattern { get throws { switch self { case let .json(body): @@ -5358,31 +8682,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SecretScanningListLocationsForAlert.Output.Ok.Body + public var body: Operations.SecretScanningUpdateRepoCustomPattern.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.SecretScanningListLocationsForAlert.Output.Ok.Headers = .init(), - body: Operations.SecretScanningListLocationsForAlert.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.SecretScanningUpdateRepoCustomPattern.Output.Ok.Body) { self.body = body } } - /// Response + /// Pattern updated successfully. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/200`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SecretScanningListLocationsForAlert.Output.Ok) + case ok(Operations.SecretScanningUpdateRepoCustomPattern.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.SecretScanningListLocationsForAlert.Output.Ok { + public var ok: Operations.SecretScanningUpdateRepoCustomPattern.Output.Ok { get throws { switch self { case let .ok(response): @@ -5395,29 +8714,63 @@ public enum Operations { } } } - public struct NotFound: Sendable, Hashable { - /// Creates a new `NotFound`. - public init() {} + /// Bad Request + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Components.Responses.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Components.Responses.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } } - /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// Forbidden /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/404`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)/responses/403`. /// - /// HTTP response code: `404 notFound`. - case notFound(Operations.SecretScanningListLocationsForAlert.Output.NotFound) - /// Repository is public, or secret scanning is disabled for the repository, or the resource is not found + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/404`. + /// - 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}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)/responses/404`. /// /// HTTP response code: `404 notFound`. - public static var notFound: Self { - .notFound(.init()) - } + case notFound(Components.Responses.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SecretScanningListLocationsForAlert.Output.NotFound { + public var notFound: Components.Responses.NotFound { get throws { switch self { case let .notFound(response): @@ -5430,24 +8783,47 @@ public enum Operations { } } } - /// Service unavailable + /// Precondition Failed /// - /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations/get(secret-scanning/list-locations-for-alert)/responses/503`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)/responses/412`. /// - /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Components.Responses.ServiceUnavailable) - /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// HTTP response code: `412 preconditionFailed`. + case preconditionFailed(Components.Responses.PreconditionFailed) + /// The associated value of the enum case if `self` is `.preconditionFailed`. /// - /// - Throws: An error if `self` is not `.serviceUnavailable`. - /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Components.Responses.ServiceUnavailable { + /// - Throws: An error if `self` is not `.preconditionFailed`. + /// - SeeAlso: `.preconditionFailed`. + public var preconditionFailed: Components.Responses.PreconditionFailed { get throws { switch self { - case let .serviceUnavailable(response): + case let .preconditionFailed(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "serviceUnavailable", + expectedStatus: "preconditionFailed", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/secret-scanning/custom-patterns/{pattern_id}/patch(secret-scanning/update-repo-custom-pattern)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", response: self ) } @@ -5460,11 +8836,14 @@ public enum Operations { } @frozen public enum AcceptableContentType: AcceptableProtocol { case json + case applicationScimJson case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { case "application/json": self = .json + case "application/scim+json": + self = .applicationScimJson default: self = .other(rawValue) } @@ -5475,11 +8854,14 @@ public enum Operations { return string case .json: return "application/json" + case .applicationScimJson: + return "application/scim+json" } } public static var allCases: [Self] { [ - .json + .json, + .applicationScimJson ] } } From f3efe232964446ba1b1d0db14665952a36d9ea07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:44:21 +0000 Subject: [PATCH 12/18] Commit via running: make Sources/teams --- Sources/teams/Client.swift | 8 +- Sources/teams/Types.swift | 188 ++++++++++++++++++++++++++++++++++++- 2 files changed, 190 insertions(+), 6 deletions(-) diff --git a/Sources/teams/Client.swift b/Sources/teams/Client.swift index 538d0aa8c0..b39b336875 100644 --- a/Sources/teams/Client.swift +++ b/Sources/teams/Client.swift @@ -673,6 +673,8 @@ public struct Client: APIProtocol { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). These fields let you read a member's role and direct/inherited status without additional requests. + /// /// To list members in a team, the team must be visible to the authenticated user. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. @@ -740,7 +742,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + [Components.Schemas.TeamMember].self, from: responseBody, transforming: { value in .json(value) @@ -1800,6 +1802,8 @@ public struct Client: APIProtocol { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). + /// /// - Remark: HTTP `GET /teams/{team_id}/members`. /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. @available(*, deprecated) @@ -1865,7 +1869,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SimpleUser].self, + [Components.Schemas.TeamMember].self, from: responseBody, transforming: { value in .json(value) diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 1465433eb2..d4140bdff9 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -73,6 +73,8 @@ public protocol APIProtocol: Sendable { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). These fields let you read a member's role and direct/inherited status without additional requests. + /// /// To list members in a team, the team must be visible to the authenticated user. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. @@ -241,6 +243,8 @@ public protocol APIProtocol: Sendable { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). + /// /// - Remark: HTTP `GET /teams/{team_id}/members`. /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. @available(*, deprecated) @@ -531,6 +535,8 @@ extension APIProtocol { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). These fields let you read a member's role and direct/inherited status without additional requests. + /// /// To list members in a team, the team must be visible to the authenticated user. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. @@ -803,6 +809,8 @@ extension APIProtocol { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). + /// /// - Remark: HTTP `GET /teams/{team_id}/members`. /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. @available(*, deprecated) @@ -3591,6 +3599,174 @@ public enum Components { case enterpriseId = "enterprise_id" } } + /// A user that is a member of a team, including their role on the team and whether the membership is inherited from a child team. + /// + /// - Remark: Generated from `#/components/schemas/team-member`. + public struct TeamMember: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/team-member/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/team-member/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/team-member/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/team-member/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/team-member/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/team-member/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/team-member/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/team-member/user_view_type`. + public var userViewType: Swift.String? + /// The member's role on the team. Only present on the `List team members` endpoint, and only when the feature is enabled for the organization. + /// + /// - Remark: Generated from `#/components/schemas/team-member/role`. + @frozen public enum RolePayload: String, Codable, Hashable, Sendable, CaseIterable { + case member = "member" + case maintainer = "maintainer" + } + /// The member's role on the team. Only present on the `List team members` endpoint, and only when the feature is enabled for the organization. + /// + /// - Remark: Generated from `#/components/schemas/team-member/role`. + public var role: Components.Schemas.TeamMember.RolePayload? + /// Whether the user is a member of the team only through a child team. `true` means the membership is inherited from a child team; `false` means the user is a direct (immediate) member of the team. Only present on the `List team members` endpoint, and only when the feature is enabled for the organization. + /// + /// - Remark: Generated from `#/components/schemas/team-member/inherited`. + public var inherited: Swift.Bool? + /// Creates a new `TeamMember`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + /// - role: The member's role on the team. Only present on the `List team members` endpoint, and only when the feature is enabled for the organization. + /// - inherited: Whether the user is a member of the team only through a child team. `true` means the membership is inherited from a child team; `false` means the user is a direct (immediate) member of the team. Only present on the `List team members` endpoint, and only when the feature is enabled for the organization. + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil, + role: Components.Schemas.TeamMember.RolePayload? = nil, + inherited: Swift.Bool? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + self.role = role + self.inherited = inherited + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + case role + case inherited + } + } /// Team Membership /// /// - Remark: Generated from `#/components/schemas/team-membership`. @@ -5814,6 +5990,8 @@ public enum Operations { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). These fields let you read a member's role and direct/inherited status without additional requests. + /// /// To list members in a team, the team must be visible to the authenticated user. /// /// - Remark: HTTP `GET /orgs/{org}/teams/{team_slug}/members`. @@ -5929,12 +6107,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/orgs/{org}/teams/{team_slug}/members/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + case json([Components.Schemas.TeamMember]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: [Components.Schemas.TeamMember] { get throws { switch self { case let .json(body): @@ -8318,6 +8496,8 @@ public enum Operations { /// /// Team members will include the members of child teams. /// + /// Each member includes their `role` on the team (`member` or `maintainer`) and an `inherited` flag indicating whether the membership is inherited from a child team (`true`) or is a direct membership (`false`). + /// /// - Remark: HTTP `GET /teams/{team_id}/members`. /// - Remark: Generated from `#/paths//teams/{team_id}/members/get(teams/list-members-legacy)`. public enum TeamsListMembersLegacy { @@ -8422,12 +8602,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/teams/{team_id}/members/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SimpleUser]) + case json([Components.Schemas.TeamMember]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SimpleUser] { + public var json: [Components.Schemas.TeamMember] { get throws { switch self { case let .json(body): From 9c5a0632a815421a237d7a15bc0a41ab3edee1a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:45:06 +0000 Subject: [PATCH 13/18] Commit via running: make Sources/code-quality --- Sources/code-quality/Types.swift | 38 +++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/Sources/code-quality/Types.swift b/Sources/code-quality/Types.swift index b6a6c5f897..a990035a9e 100644 --- a/Sources/code-quality/Types.swift +++ b/Sources/code-quality/Types.swift @@ -487,6 +487,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/code-quality-setup/schedule`. public var schedule: Components.Schemas.CodeQualitySetup.SchedulePayload? + /// The AI findings configuration for the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-quality-setup/ai_findings_option`. + @frozen public enum AiFindingsOptionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disabled = "disabled" + case onPush = "on_push" + } + /// The AI findings configuration for the repository. + /// + /// - Remark: Generated from `#/components/schemas/code-quality-setup/ai_findings_option`. + public var aiFindingsOption: Components.Schemas.CodeQualitySetup.AiFindingsOptionPayload? /// Creates a new `CodeQualitySetup`. /// /// - Parameters: @@ -496,13 +507,15 @@ public enum Components { /// - runnerLabel: Runner label to be used if the runner type is labeled. /// - updatedAt: Timestamp of latest configuration update. /// - schedule: The frequency of the periodic analysis. + /// - aiFindingsOption: The AI findings configuration for the repository. public init( state: Components.Schemas.CodeQualitySetup.StatePayload? = nil, languages: Components.Schemas.CodeQualitySetup.LanguagesPayload? = nil, runnerType: Components.Schemas.CodeQualitySetup.RunnerTypePayload? = nil, runnerLabel: Swift.String? = nil, updatedAt: Foundation.Date? = nil, - schedule: Components.Schemas.CodeQualitySetup.SchedulePayload? = nil + schedule: Components.Schemas.CodeQualitySetup.SchedulePayload? = nil, + aiFindingsOption: Components.Schemas.CodeQualitySetup.AiFindingsOptionPayload? = nil ) { self.state = state self.languages = languages @@ -510,6 +523,7 @@ public enum Components { self.runnerLabel = runnerLabel self.updatedAt = updatedAt self.schedule = schedule + self.aiFindingsOption = aiFindingsOption } public enum CodingKeys: String, CodingKey { case state @@ -518,6 +532,7 @@ public enum Components { case runnerLabel = "runner_label" case updatedAt = "updated_at" case schedule + case aiFindingsOption = "ai_findings_option" } } /// Configuration for code quality setup. @@ -552,6 +567,13 @@ public enum Components { } /// - Remark: Generated from `#/components/schemas/code-quality-setup-update/value4`. public var value4: Components.Schemas.CodeQualitySetupUpdate.Value4Payload? + /// - Remark: Generated from `#/components/schemas/code-quality-setup-update/value5`. + public struct Value5Payload: Codable, Hashable, Sendable { + /// Creates a new `Value5Payload`. + public init() {} + } + /// - Remark: Generated from `#/components/schemas/code-quality-setup-update/value5`. + public var value5: Components.Schemas.CodeQualitySetupUpdate.Value5Payload? /// Creates a new `CodeQualitySetupUpdate`. /// /// - Parameters: @@ -559,16 +581,19 @@ public enum Components { /// - value2: /// - value3: /// - value4: + /// - value5: public init( value1: Components.Schemas.CodeQualitySetupUpdate.Value1Payload? = nil, value2: Components.Schemas.CodeQualitySetupUpdate.Value2Payload? = nil, value3: Components.Schemas.CodeQualitySetupUpdate.Value3Payload? = nil, - value4: Components.Schemas.CodeQualitySetupUpdate.Value4Payload? = nil + value4: Components.Schemas.CodeQualitySetupUpdate.Value4Payload? = nil, + value5: Components.Schemas.CodeQualitySetupUpdate.Value5Payload? = nil ) { self.value1 = value1 self.value2 = value2 self.value3 = value3 self.value4 = value4 + self.value5 = value5 } public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] @@ -592,12 +617,18 @@ public enum Components { } catch { errors.append(error) } + do { + self.value5 = try .init(from: decoder) + } catch { + errors.append(error) + } try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( [ self.value1, self.value2, self.value3, - self.value4 + self.value4, + self.value5 ], type: Self.self, codingPath: decoder.codingPath, @@ -609,6 +640,7 @@ public enum Components { try self.value2?.encode(to: encoder) try self.value3?.encode(to: encoder) try self.value4?.encode(to: encoder) + try self.value5?.encode(to: encoder) } } /// You can use `run_url` to track the status of the run. This includes a property status and conclusion. From bfbd098e62a4d1a8fa96e212e552bf98eabed3dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:45:52 +0000 Subject: [PATCH 14/18] Commit via running: make Sources/copilot --- Sources/copilot/Client.swift | 292 +++++++++++++++++ Sources/copilot/Types.swift | 608 ++++++++++++++++++++++++++++++++++- 2 files changed, 899 insertions(+), 1 deletion(-) diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 75e0a4c422..9a3551a063 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -317,6 +317,151 @@ public struct Client: APIProtocol { } ) } + /// Get Copilot enterprise repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot enterprise repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the enterprise, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Enterprise owners, billing managers, and authorized users with fine-grained "View Enterprise Copilot Metrics" permission can retrieve Copilot metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)`. + public func copilotCopilotEnterpriseReposOneDayReport(_ input: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input) async throws -> Operations.CopilotCopilotEnterpriseReposOneDayReport.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotCopilotEnterpriseReposOneDayReport.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/enterprises/{}/copilot/metrics/reports/repos-1-day", + parameters: [ + input.path.enterprise + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotCopilotEnterpriseReposOneDayReport.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.CopilotUsageMetrics1DayReport.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 204: + return .noContent(.init()) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get Copilot enterprise user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot enterprise user-teams report for a specific day. The report provides user-team join data for Copilot across the enterprise, with one entry per user-team pair. @@ -3795,6 +3940,153 @@ public struct Client: APIProtocol { } ) } + /// Get Copilot organization repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the organization, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Organization owners and authorized users with fine-grained "View Organization Copilot Metrics" permission can retrieve Copilot metrics reports for the organization. OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// For more information about organization metrics attribution, see [How are metrics attributed across organizations](https://docs.github.com/copilot/concepts/copilot-metrics#how-are-metrics-attributed-across-organizations). + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)`. + public func copilotCopilotOrganizationReposOneDayReport(_ input: Operations.CopilotCopilotOrganizationReposOneDayReport.Input) async throws -> Operations.CopilotCopilotOrganizationReposOneDayReport.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotCopilotOrganizationReposOneDayReport.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/metrics/reports/repos-1-day", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "day", + value: input.query.day + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotCopilotOrganizationReposOneDayReport.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.CopilotUsageMetrics1DayReport.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 204: + return .noContent(.init()) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.InternalError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get Copilot organization user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot organization user-teams report for a specific day. The report provides user-team join data for Copilot across the organization, with one entry per user-team pair. diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index b0897e8bac..ef4059836d 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -37,6 +37,19 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/get(copilot/copilot-enterprise-usage-metrics)`. func copilotCopilotEnterpriseUsageMetrics(_ input: Operations.CopilotCopilotEnterpriseUsageMetrics.Input) async throws -> Operations.CopilotCopilotEnterpriseUsageMetrics.Output + /// Get Copilot enterprise repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot enterprise repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the enterprise, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Enterprise owners, billing managers, and authorized users with fine-grained "View Enterprise Copilot Metrics" permission can retrieve Copilot metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)`. + func copilotCopilotEnterpriseReposOneDayReport(_ input: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input) async throws -> Operations.CopilotCopilotEnterpriseReposOneDayReport.Output /// Get Copilot enterprise user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot enterprise user-teams report for a specific day. The report provides user-team join data for Copilot across the enterprise, with one entry per user-team pair. @@ -387,6 +400,21 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest`. /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-28-day/latest/get(copilot/copilot-organization-usage-metrics)`. func copilotCopilotOrganizationUsageMetrics(_ input: Operations.CopilotCopilotOrganizationUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationUsageMetrics.Output + /// Get Copilot organization repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the organization, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Organization owners and authorized users with fine-grained "View Organization Copilot Metrics" permission can retrieve Copilot metrics reports for the organization. OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// For more information about organization metrics attribution, see [How are metrics attributed across organizations](https://docs.github.com/copilot/concepts/copilot-metrics#how-are-metrics-attributed-across-organizations). + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)`. + func copilotCopilotOrganizationReposOneDayReport(_ input: Operations.CopilotCopilotOrganizationReposOneDayReport.Input) async throws -> Operations.CopilotCopilotOrganizationReposOneDayReport.Output /// Get Copilot organization user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot organization user-teams report for a specific day. The report provides user-team join data for Copilot across the organization, with one entry per user-team pair. @@ -511,6 +539,29 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot enterprise repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot enterprise repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the enterprise, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Enterprise owners, billing managers, and authorized users with fine-grained "View Enterprise Copilot Metrics" permission can retrieve Copilot metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)`. + public func copilotCopilotEnterpriseReposOneDayReport( + path: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Path, + query: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Query, + headers: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotEnterpriseReposOneDayReport.Output { + try await copilotCopilotEnterpriseReposOneDayReport(Operations.CopilotCopilotEnterpriseReposOneDayReport.Input( + path: path, + query: query, + headers: headers + )) + } /// Get Copilot enterprise user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot enterprise user-teams report for a specific day. The report provides user-team join data for Copilot across the enterprise, with one entry per user-team pair. @@ -1067,6 +1118,31 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot organization repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the organization, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Organization owners and authorized users with fine-grained "View Organization Copilot Metrics" permission can retrieve Copilot metrics reports for the organization. OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// For more information about organization metrics attribution, see [How are metrics attributed across organizations](https://docs.github.com/copilot/concepts/copilot-metrics#how-are-metrics-attributed-across-organizations). + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)`. + public func copilotCopilotOrganizationReposOneDayReport( + path: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Path, + query: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Query, + headers: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotOrganizationReposOneDayReport.Output { + try await copilotCopilotOrganizationReposOneDayReport(Operations.CopilotCopilotOrganizationReposOneDayReport.Input( + path: path, + query: query, + headers: headers + )) + } /// Get Copilot organization user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot organization user-teams report for a specific day. The report provides user-team join data for Copilot across the organization, with one entry per user-team pair. @@ -4611,6 +4687,262 @@ public enum Operations { } } } + /// Get Copilot enterprise repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot enterprise repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the enterprise, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Enterprise owners, billing managers, and authorized users with fine-grained "View Enterprise Copilot Metrics" permission can retrieve Copilot metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)`. + public enum CopilotCopilotEnterpriseReposOneDayReport { + public static let id: Swift.String = "copilot/copilot-enterprise-repos-one-day-report" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/GET/query`. + public struct Query: Sendable, Hashable { + /// The day to request data for, in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/GET/query/day`. + public var day: Components.Parameters.Day + /// Creates a new `Query`. + /// + /// - Parameters: + /// - day: The day to request data for, in `YYYY-MM-DD` format. + public init(day: Components.Parameters.Day) { + self.day = day + } + } + public var query: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/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.CopilotCopilotEnterpriseReposOneDayReport.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Path, + query: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Query, + headers: Operations.CopilotCopilotEnterpriseReposOneDayReport.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotUsageMetrics1DayReport) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.CopilotUsageMetrics1DayReport { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCopilotEnterpriseReposOneDayReport.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCopilotEnterpriseReposOneDayReport.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotEnterpriseReposOneDayReport.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.CopilotCopilotEnterpriseReposOneDayReport.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-enterprise-repos-one-day-report)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Get Copilot enterprise user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot enterprise user-teams report for a specific day. The report provides user-team join data for Copilot across the enterprise, with one entry per user-team pair. @@ -10504,6 +10836,264 @@ public enum Operations { } } } + /// Get Copilot organization repository report for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization repository report for a specific day. The report provides per-repository pull request metrics for Copilot across the organization, with one entry per repository. + /// + /// The report contains repository-level pull request activity for the specified day, including the Copilot Coding Agent (CCA) and Copilot Code Review (CCR) breakdowns. Only repositories that had activity on the specified day are included. Reports are generated daily and made available for download through signed URLs with a limited expiration time. + /// + /// The response includes download links to the report files, along with the specific date of the report. The report covers a complete day for which data has been processed. + /// + /// Organization owners and authorized users with fine-grained "View Organization Copilot Metrics" permission can retrieve Copilot metrics reports for the organization. OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. + /// + /// For more information about organization metrics attribution, see [How are metrics attributed across organizations](https://docs.github.com/copilot/concepts/copilot-metrics#how-are-metrics-attributed-across-organizations). + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/repos-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)`. + public enum CopilotCopilotOrganizationReposOneDayReport { + public static let id: Swift.String = "copilot/copilot-organization-repos-one-day-report" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/repos-1-day/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/repos-1-day/GET/path/org`. + public var org: Components.Parameters.Org + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + public init(org: Components.Parameters.Org) { + self.org = org + } + } + public var path: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/repos-1-day/GET/query`. + public struct Query: Sendable, Hashable { + /// The day to request data for, in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/repos-1-day/GET/query/day`. + public var day: Components.Parameters.Day + /// Creates a new `Query`. + /// + /// - Parameters: + /// - day: The day to request data for, in `YYYY-MM-DD` format. + public init(day: Components.Parameters.Day) { + self.day = day + } + } + public var query: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/repos-1-day/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.CopilotCopilotOrganizationReposOneDayReport.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Path, + query: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Query, + headers: Operations.CopilotCopilotOrganizationReposOneDayReport.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/repos-1-day/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/repos-1-day/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotUsageMetrics1DayReport) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.CopilotUsageMetrics1DayReport { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCopilotOrganizationReposOneDayReport.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCopilotOrganizationReposOneDayReport.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotOrganizationReposOneDayReport.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.CopilotCopilotOrganizationReposOneDayReport.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Components.Responses.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.InternalError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/repos-1-day/get(copilot/copilot-organization-repos-one-day-report)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Get Copilot organization user-teams report for a specific day /// /// Use this endpoint to retrieve download links for the Copilot organization user-teams report for a specific day. The report provides user-team join data for Copilot across the organization, with one entry per user-team pair. @@ -11671,6 +12261,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/copilot/cloud-agent/configuration/GET/responses/200/content/json/custom_allowlist`. public var customAllowlist: [Swift.String] + /// Whether automations are enabled in this repository. When true, users can create automations that automatically run agents on a schedule or in response to events like new issues or updated pull requests. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/copilot/cloud-agent/configuration/GET/responses/200/content/json/is_automations_enabled`. + public var isAutomationsEnabled: Swift.Bool + /// Whether write access is required for automation triggers. When true, automations will only run if the user triggering the event has write access to the repository. When false, users can create automations that listen for events triggered by users without write access. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/copilot/cloud-agent/configuration/GET/responses/200/content/json/require_write_access_for_automation_triggers`. + public var requireWriteAccessForAutomationTriggers: Swift.Bool /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -11680,13 +12278,17 @@ public enum Operations { /// - isFirewallEnabled: Whether the firewall is enabled. /// - isFirewallRecommendedAllowlistEnabled: Whether the firewall recommended allowlist is enabled. /// - customAllowlist: A list of custom allowlist entries, as hosts or URLs, that the firewall will allow the Copilot cloud agent to access. + /// - isAutomationsEnabled: Whether automations are enabled in this repository. When true, users can create automations that automatically run agents on a schedule or in response to events like new issues or updated pull requests. + /// - requireWriteAccessForAutomationTriggers: Whether write access is required for automation triggers. When true, automations will only run if the user triggering the event has write access to the repository. When false, users can create automations that listen for events triggered by users without write access. public init( mcpConfiguration: Operations.CopilotGetCopilotCloudAgentConfiguration.Output.Ok.Body.JsonPayload.McpConfigurationPayload? = nil, enabledTools: Operations.CopilotGetCopilotCloudAgentConfiguration.Output.Ok.Body.JsonPayload.EnabledToolsPayload, requireActionsWorkflowApproval: Swift.Bool, isFirewallEnabled: Swift.Bool, isFirewallRecommendedAllowlistEnabled: Swift.Bool, - customAllowlist: [Swift.String] + customAllowlist: [Swift.String], + isAutomationsEnabled: Swift.Bool, + requireWriteAccessForAutomationTriggers: Swift.Bool ) { self.mcpConfiguration = mcpConfiguration self.enabledTools = enabledTools @@ -11694,6 +12296,8 @@ public enum Operations { self.isFirewallEnabled = isFirewallEnabled self.isFirewallRecommendedAllowlistEnabled = isFirewallRecommendedAllowlistEnabled self.customAllowlist = customAllowlist + self.isAutomationsEnabled = isAutomationsEnabled + self.requireWriteAccessForAutomationTriggers = requireWriteAccessForAutomationTriggers } public enum CodingKeys: String, CodingKey { case mcpConfiguration = "mcp_configuration" @@ -11702,6 +12306,8 @@ public enum Operations { case isFirewallEnabled = "is_firewall_enabled" case isFirewallRecommendedAllowlistEnabled = "is_firewall_recommended_allowlist_enabled" case customAllowlist = "custom_allowlist" + case isAutomationsEnabled = "is_automations_enabled" + case requireWriteAccessForAutomationTriggers = "require_write_access_for_automation_triggers" } } /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/copilot/cloud-agent/configuration/GET/responses/200/content/application\/json`. From 0756b300a85b6fbfb5c920f00b9c2d86e8561782 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:47:01 +0000 Subject: [PATCH 15/18] Commit via running: make Sources/interactions --- Sources/interactions/Client.swift | 301 +++++++++++++- Sources/interactions/Types.swift | 659 +++++++++++++++++++++++++++++- 2 files changed, 956 insertions(+), 4 deletions(-) diff --git a/Sources/interactions/Client.swift b/Sources/interactions/Client.swift index 3df890fa33..f7ca891567 100644 --- a/Sources/interactions/Client.swift +++ b/Sources/interactions/Client.swift @@ -427,7 +427,7 @@ public struct Client: APIProtocol { /// repository. Users on this list can create pull requests regardless of any /// configured pull request creation cap. /// - /// Only repository admins can view the bypass list. + /// Only users with maintainer permissions can view the bypass list. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. @@ -784,6 +784,305 @@ public struct Client: APIProtocol { } ) } + /// Get pull request creation cap for a repository + /// + /// Gets the pull request creation cap configuration for a repository. + /// The cap limits the number of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can view the cap configuration. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)`. + public func interactionsGetPullRequestCreationCapForRepo(_ input: Operations.InteractionsGetPullRequestCreationCapForRepo.Input) async throws -> Operations.InteractionsGetPullRequestCreationCapForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.InteractionsGetPullRequestCreationCapForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/interaction-limits/pulls/creation-cap", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.InteractionsGetPullRequestCreationCapForRepo.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Update pull request creation cap for a repository + /// + /// Updates the pull request creation cap for a repository. The cap limits the number + /// of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can configure the cap. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)`. + public func interactionsUpdatePullRequestCreationCapForRepo(_ input: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input) async throws -> Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.InteractionsUpdatePullRequestCreationCapForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/interaction-limits/pulls/creation-cap", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + 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.InteractionsUpdatePullRequestCreationCapForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires. diff --git a/Sources/interactions/Types.swift b/Sources/interactions/Types.swift index 17447f125d..c0302a2cfc 100644 --- a/Sources/interactions/Types.swift +++ b/Sources/interactions/Types.swift @@ -59,7 +59,7 @@ public protocol APIProtocol: Sendable { /// repository. Users on this list can create pull requests regardless of any /// configured pull request creation cap. /// - /// Only repository admins can view the bypass list. + /// Only users with maintainer permissions can view the bypass list. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. @@ -88,6 +88,26 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)`. func interactionsRemovePullRequestBypassListForRepo(_ input: Operations.InteractionsRemovePullRequestBypassListForRepo.Input) async throws -> Operations.InteractionsRemovePullRequestBypassListForRepo.Output + /// Get pull request creation cap for a repository + /// + /// Gets the pull request creation cap configuration for a repository. + /// The cap limits the number of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can view the cap configuration. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)`. + func interactionsGetPullRequestCreationCapForRepo(_ input: Operations.InteractionsGetPullRequestCreationCapForRepo.Input) async throws -> Operations.InteractionsGetPullRequestCreationCapForRepo.Output + /// Update pull request creation cap for a repository + /// + /// Updates the pull request creation cap for a repository. The cap limits the number + /// of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can configure the cap. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)`. + func interactionsUpdatePullRequestCreationCapForRepo(_ input: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input) async throws -> Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires. @@ -201,7 +221,7 @@ extension APIProtocol { /// repository. Users on this list can create pull requests regardless of any /// configured pull request creation cap. /// - /// Only repository admins can view the bypass list. + /// Only users with maintainer permissions can view the bypass list. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. @@ -258,6 +278,44 @@ extension APIProtocol { body: body )) } + /// Get pull request creation cap for a repository + /// + /// Gets the pull request creation cap configuration for a repository. + /// The cap limits the number of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can view the cap configuration. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)`. + public func interactionsGetPullRequestCreationCapForRepo( + path: Operations.InteractionsGetPullRequestCreationCapForRepo.Input.Path, + headers: Operations.InteractionsGetPullRequestCreationCapForRepo.Input.Headers = .init() + ) async throws -> Operations.InteractionsGetPullRequestCreationCapForRepo.Output { + try await interactionsGetPullRequestCreationCapForRepo(Operations.InteractionsGetPullRequestCreationCapForRepo.Input( + path: path, + headers: headers + )) + } + /// Update pull request creation cap for a repository + /// + /// Updates the pull request creation cap for a repository. The cap limits the number + /// of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can configure the cap. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)`. + public func interactionsUpdatePullRequestCreationCapForRepo( + path: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input.Path, + headers: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input.Headers = .init(), + body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input.Body + ) async throws -> Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output { + try await interactionsUpdatePullRequestCreationCapForRepo(Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input( + path: path, + headers: headers, + body: body + )) + } /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires. @@ -1753,7 +1811,7 @@ public enum Operations { /// repository. Users on this list can create pull requests regardless of any /// configured pull request creation cap. /// - /// Only repository admins can view the bypass list. + /// Only users with maintainer permissions can view the bypass list. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. @@ -2354,6 +2412,601 @@ public enum Operations { } } } + /// Get pull request creation cap for a repository + /// + /// Gets the pull request creation cap configuration for a repository. + /// The cap limits the number of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can view the cap configuration. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)`. + public enum InteractionsGetPullRequestCreationCapForRepo { + public static let id: Swift.String = "interactions/get-pull-request-creation-cap-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/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}/interaction-limits/pulls/creation-cap/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}/interaction-limits/pulls/creation-cap/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.InteractionsGetPullRequestCreationCapForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/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.InteractionsGetPullRequestCreationCapForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.InteractionsGetPullRequestCreationCapForRepo.Input.Path, + headers: Operations.InteractionsGetPullRequestCreationCapForRepo.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Whether the pull request creation cap is enabled + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/GET/responses/200/content/json/enabled`. + public var enabled: Swift.Bool + /// The maximum number of open pull requests a user can have at one time + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/GET/responses/200/content/json/max_open_pull_requests`. + public var maxOpenPullRequests: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabled: Whether the pull request creation cap is enabled + /// - maxOpenPullRequests: The maximum number of open pull requests a user can have at one time + public init( + enabled: Swift.Bool, + maxOpenPullRequests: Swift.Int + ) { + self.enabled = enabled + self.maxOpenPullRequests = maxOpenPullRequests + } + public enum CodingKeys: String, CodingKey { + case enabled + case maxOpenPullRequests = "max_open_pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/GET/responses/200/content/application\/json`. + case json(Operations.InteractionsGetPullRequestCreationCapForRepo.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.InteractionsGetPullRequestCreationCapForRepo.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.InteractionsGetPullRequestCreationCapForRepo.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}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/GET/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/GET/responses/405/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Method Not Allowed + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/get(interactions/get-pull-request-creation-cap-for-repo)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.InteractionsGetPullRequestCreationCapForRepo.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.InteractionsGetPullRequestCreationCapForRepo.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Update pull request creation cap for a repository + /// + /// Updates the pull request creation cap for a repository. The cap limits the number + /// of open pull requests a user can have at one time. + /// + /// Only users with admin access to the repository can configure the cap. + /// + /// - Remark: HTTP `PATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-cap`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)`. + public enum InteractionsUpdatePullRequestCreationCapForRepo { + public static let id: Swift.String = "interactions/update-pull-request-creation-cap-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/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}/interaction-limits/pulls/creation-cap/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}/interaction-limits/pulls/creation-cap/PATCH/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.InteractionsUpdatePullRequestCreationCapForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/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.InteractionsUpdatePullRequestCreationCapForRepo.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Whether the pull request creation cap is enabled + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/requestBody/json/enabled`. + public var enabled: Swift.Bool + /// The maximum number of open pull requests a user can have at one time + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/requestBody/json/max_open_pull_requests`. + public var maxOpenPullRequests: Swift.Int? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabled: Whether the pull request creation cap is enabled + /// - maxOpenPullRequests: The maximum number of open pull requests a user can have at one time + public init( + enabled: Swift.Bool, + maxOpenPullRequests: Swift.Int? = nil + ) { + self.enabled = enabled + self.maxOpenPullRequests = maxOpenPullRequests + } + public enum CodingKeys: String, CodingKey { + case enabled + case maxOpenPullRequests = "max_open_pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/requestBody/content/application\/json`. + case json(Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input.Body.JsonPayload) + } + public var body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input.Path, + headers: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Input.Headers = .init(), + body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.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}/interaction-limits/pulls/creation-cap/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Whether the pull request creation cap is enabled + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/responses/200/content/json/enabled`. + public var enabled: Swift.Bool + /// The maximum number of open pull requests a user can have at one time + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/responses/200/content/json/max_open_pull_requests`. + public var maxOpenPullRequests: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabled: Whether the pull request creation cap is enabled + /// - maxOpenPullRequests: The maximum number of open pull requests a user can have at one time + public init( + enabled: Swift.Bool, + maxOpenPullRequests: Swift.Int + ) { + self.enabled = enabled + self.maxOpenPullRequests = maxOpenPullRequests + } + public enum CodingKeys: String, CodingKey { + case enabled + case maxOpenPullRequests = "max_open_pull_requests" + } + } + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/responses/200/content/application\/json`. + case json(Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.InteractionsUpdatePullRequestCreationCapForRepo.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.InteractionsUpdatePullRequestCreationCapForRepo.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}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/PATCH/responses/405/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Method Not Allowed + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.InteractionsUpdatePullRequestCreationCapForRepo.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/creation-cap/patch(interactions/update-pull-request-creation-cap-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires. From 497015d1464587487acbb1bb6b5d0c3608fb6013 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:47:24 +0000 Subject: [PATCH 16/18] Commit via running: make Sources/classroom --- Sources/classroom/Client.swift | 174 +++++++++++++++++++- Sources/classroom/Types.swift | 286 ++++++++++++++++++++++++++++++--- 2 files changed, 436 insertions(+), 24 deletions(-) diff --git a/Sources/classroom/Client.swift b/Sources/classroom/Client.swift index 9c71d4726f..e0cb28555e 100644 --- a/Sources/classroom/Client.swift +++ b/Sources/classroom/Client.swift @@ -38,12 +38,17 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// Get an assignment + /// Closing down - Get an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/get(classroom/get-an-assignment)`. + @available(*, deprecated) public func classroomGetAnAssignment(_ input: Operations.ClassroomGetAnAssignment.Input) async throws -> Operations.ClassroomGetAnAssignment.Output { try await client.send( input: input, @@ -112,6 +117,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -124,12 +151,17 @@ public struct Client: APIProtocol { } ) } - /// List accepted assignments for an assignment + /// Closing down - List accepted assignments for an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`. + @available(*, deprecated) public func classroomListAcceptedAssignmentsForAnAssignment(_ input: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input) async throws -> Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Output { try await client.send( input: input, @@ -190,6 +222,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -202,12 +256,17 @@ public struct Client: APIProtocol { } ) } - /// Get assignment grades + /// Closing down - Get assignment grades + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/grades`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/grades/get(classroom/get-assignment-grades)`. + @available(*, deprecated) public func classroomGetAssignmentGrades(_ input: Operations.ClassroomGetAssignmentGrades.Input) async throws -> Operations.ClassroomGetAssignmentGrades.Output { try await client.send( input: input, @@ -276,6 +335,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -288,12 +369,17 @@ public struct Client: APIProtocol { } ) } - /// List classrooms + /// Closing down - List classrooms + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. /// /// - Remark: HTTP `GET /classrooms`. /// - Remark: Generated from `#/paths//classrooms/get(classroom/list-classrooms)`. + @available(*, deprecated) public func classroomListClassrooms(_ input: Operations.ClassroomListClassrooms.Input) async throws -> Operations.ClassroomListClassrooms.Output { try await client.send( input: input, @@ -352,6 +438,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -364,12 +472,17 @@ public struct Client: APIProtocol { } ) } - /// Get a classroom + /// Closing down - Get a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom. /// /// - Remark: HTTP `GET /classrooms/{classroom_id}`. /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/get(classroom/get-a-classroom)`. + @available(*, deprecated) public func classroomGetAClassroom(_ input: Operations.ClassroomGetAClassroom.Input) async throws -> Operations.ClassroomGetAClassroom.Output { try await client.send( input: input, @@ -438,6 +551,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -450,12 +585,17 @@ public struct Client: APIProtocol { } ) } - /// List assignments for a classroom + /// Closing down - List assignments for a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. /// /// - Remark: HTTP `GET /classrooms/{classroom_id}/assignments`. /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/assignments/get(classroom/list-assignments-for-a-classroom)`. + @available(*, deprecated) public func classroomListAssignmentsForAClassroom(_ input: Operations.ClassroomListAssignmentsForAClassroom.Input) async throws -> Operations.ClassroomListAssignmentsForAClassroom.Output { try await client.send( input: input, @@ -516,6 +656,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 410: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Gone.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .gone(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/classroom/Types.swift b/Sources/classroom/Types.swift index b04289a262..fcc5373d20 100644 --- a/Sources/classroom/Types.swift +++ b/Sources/classroom/Types.swift @@ -11,58 +11,93 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { - /// Get an assignment + /// Closing down - Get an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/get(classroom/get-an-assignment)`. + @available(*, deprecated) func classroomGetAnAssignment(_ input: Operations.ClassroomGetAnAssignment.Input) async throws -> Operations.ClassroomGetAnAssignment.Output - /// List accepted assignments for an assignment + /// Closing down - List accepted assignments for an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`. + @available(*, deprecated) func classroomListAcceptedAssignmentsForAnAssignment(_ input: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input) async throws -> Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Output - /// Get assignment grades + /// Closing down - Get assignment grades + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/grades`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/grades/get(classroom/get-assignment-grades)`. + @available(*, deprecated) func classroomGetAssignmentGrades(_ input: Operations.ClassroomGetAssignmentGrades.Input) async throws -> Operations.ClassroomGetAssignmentGrades.Output - /// List classrooms + /// Closing down - List classrooms + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. /// /// - Remark: HTTP `GET /classrooms`. /// - Remark: Generated from `#/paths//classrooms/get(classroom/list-classrooms)`. + @available(*, deprecated) func classroomListClassrooms(_ input: Operations.ClassroomListClassrooms.Input) async throws -> Operations.ClassroomListClassrooms.Output - /// Get a classroom + /// Closing down - Get a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom. /// /// - Remark: HTTP `GET /classrooms/{classroom_id}`. /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/get(classroom/get-a-classroom)`. + @available(*, deprecated) func classroomGetAClassroom(_ input: Operations.ClassroomGetAClassroom.Input) async throws -> Operations.ClassroomGetAClassroom.Output - /// List assignments for a classroom + /// Closing down - List assignments for a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. /// /// - Remark: HTTP `GET /classrooms/{classroom_id}/assignments`. /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/assignments/get(classroom/list-assignments-for-a-classroom)`. + @available(*, deprecated) func classroomListAssignmentsForAClassroom(_ input: Operations.ClassroomListAssignmentsForAClassroom.Input) async throws -> Operations.ClassroomListAssignmentsForAClassroom.Output } /// Convenience overloads for operation inputs. extension APIProtocol { - /// Get an assignment + /// Closing down - Get an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/get(classroom/get-an-assignment)`. + @available(*, deprecated) public func classroomGetAnAssignment( path: Operations.ClassroomGetAnAssignment.Input.Path, headers: Operations.ClassroomGetAnAssignment.Input.Headers = .init() @@ -72,12 +107,17 @@ extension APIProtocol { headers: headers )) } - /// List accepted assignments for an assignment + /// Closing down - List accepted assignments for an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`. + @available(*, deprecated) public func classroomListAcceptedAssignmentsForAnAssignment( path: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input.Path, query: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input.Query = .init(), @@ -89,12 +129,17 @@ extension APIProtocol { headers: headers )) } - /// Get assignment grades + /// Closing down - Get assignment grades + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// /// - Remark: HTTP `GET /assignments/{assignment_id}/grades`. /// - Remark: Generated from `#/paths//assignments/{assignment_id}/grades/get(classroom/get-assignment-grades)`. + @available(*, deprecated) public func classroomGetAssignmentGrades( path: Operations.ClassroomGetAssignmentGrades.Input.Path, headers: Operations.ClassroomGetAssignmentGrades.Input.Headers = .init() @@ -104,12 +149,17 @@ extension APIProtocol { headers: headers )) } - /// List classrooms + /// Closing down - List classrooms + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. /// /// - Remark: HTTP `GET /classrooms`. /// - Remark: Generated from `#/paths//classrooms/get(classroom/list-classrooms)`. + @available(*, deprecated) public func classroomListClassrooms( query: Operations.ClassroomListClassrooms.Input.Query = .init(), headers: Operations.ClassroomListClassrooms.Input.Headers = .init() @@ -119,12 +169,17 @@ extension APIProtocol { headers: headers )) } - /// Get a classroom + /// Closing down - Get a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom. /// /// - Remark: HTTP `GET /classrooms/{classroom_id}`. /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/get(classroom/get-a-classroom)`. + @available(*, deprecated) public func classroomGetAClassroom( path: Operations.ClassroomGetAClassroom.Input.Path, headers: Operations.ClassroomGetAClassroom.Input.Headers = .init() @@ -134,12 +189,17 @@ extension APIProtocol { headers: headers )) } - /// List assignments for a classroom + /// Closing down - List assignments for a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. /// /// - Remark: HTTP `GET /classrooms/{classroom_id}/assignments`. /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/assignments/get(classroom/list-assignments-for-a-classroom)`. + @available(*, deprecated) public func classroomListAssignmentsForAClassroom( path: Operations.ClassroomListAssignmentsForAClassroom.Input.Path, query: Operations.ClassroomListAssignmentsForAClassroom.Input.Query = .init(), @@ -1010,6 +1070,34 @@ public enum Components { self.body = body } } + public struct Gone: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/gone/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Gone.Body + /// Creates a new `Gone`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Gone.Body) { + self.body = body + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} @@ -1017,7 +1105,11 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// Get an assignment + /// Closing down - Get an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// @@ -1141,6 +1233,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/get(classroom/get-an-assignment)/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. @@ -1172,7 +1287,11 @@ public enum Operations { } } } - /// List accepted assignments for an assignment + /// Closing down - List accepted assignments for an assignment + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// @@ -1300,6 +1419,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)/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. @@ -1331,7 +1473,11 @@ public enum Operations { } } } - /// Get assignment grades + /// Closing down - Get assignment grades + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. /// @@ -1455,6 +1601,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//assignments/{assignment_id}/grades/get(classroom/get-assignment-grades)/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. @@ -1486,7 +1655,11 @@ public enum Operations { } } } - /// List classrooms + /// Closing down - List classrooms + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. /// @@ -1596,6 +1769,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//classrooms/get(classroom/list-classrooms)/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. @@ -1627,7 +1823,11 @@ public enum Operations { } } } - /// Get a classroom + /// Closing down - Get a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom. /// @@ -1751,6 +1951,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/get(classroom/get-a-classroom)/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. @@ -1782,7 +2005,11 @@ public enum Operations { } } } - /// List assignments for a classroom + /// Closing down - List assignments for a classroom + /// + /// > [!WARNING] + /// > **Closing down notice:** This operation is closing down and will be removed on August 28, 2026. + /// > For more information, see the [GitHub Classroom sunset notice](https://gh.io/classroom-sunset). /// /// Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. /// @@ -1910,6 +2137,29 @@ public enum Operations { } } } + /// Gone + /// + /// - Remark: Generated from `#/paths//classrooms/{classroom_id}/assignments/get(classroom/list-assignments-for-a-classroom)/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. From b7277d925a57e2f0d0b59c69a10c20fb75002281 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:51:12 +0000 Subject: [PATCH 17/18] Commit via running: make Sources/projects --- Sources/projects/Types.swift | 84 ++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index 67dc351649..99492e20cd 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -4066,6 +4066,84 @@ public enum Components { case commitMessage = "commit_message" } } + /// The stack information associated with a pull request. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack`. + public struct PullRequestStack: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public struct BasePayload: Codable, Hashable, Sendable { + /// The base ref of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/ref`. + public var ref: Swift.String + /// The base SHA of the stack this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base/sha`. + public var sha: Swift.String + /// Creates a new `BasePayload`. + /// + /// - Parameters: + /// - ref: The base ref of the stack this pull request belongs to. + /// - sha: The base SHA of the stack this pull request belongs to. + public init( + ref: Swift.String, + sha: Swift.String + ) { + self.ref = ref + self.sha = sha + } + public enum CodingKeys: String, CodingKey { + case ref + case sha + } + } + /// - Remark: Generated from `#/components/schemas/pull-request-stack/base`. + public var base: Components.Schemas.PullRequestStack.BasePayload + /// The total number of pull requests in the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/size`. + public var size: Swift.Int? + /// The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/position`. + public var position: Swift.Int? + /// The ID of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/id`. + public var id: Swift.Int? + /// The number of the stack that this pull request belongs to. + /// + /// - Remark: Generated from `#/components/schemas/pull-request-stack/number`. + public var number: Swift.Int? + /// Creates a new `PullRequestStack`. + /// + /// - Parameters: + /// - base: + /// - size: The total number of pull requests in the stack. + /// - position: The one-based position of this pull request within the stack, where 1 is the bottom of the stack. + /// - id: The ID of the stack that this pull request belongs to. + /// - number: The number of the stack that this pull request belongs to. + public init( + base: Components.Schemas.PullRequestStack.BasePayload, + size: Swift.Int? = nil, + position: Swift.Int? = nil, + id: Swift.Int? = nil, + number: Swift.Int? = nil + ) { + self.base = base + self.size = size + self.position = position + self.id = id + self.number = number + } + public enum CodingKeys: String, CodingKey { + case base + case size + case position + case id + case number + } + } /// Pull Request Simple /// /// - Remark: Generated from `#/components/schemas/pull-request-simple`. @@ -4336,6 +4414,8 @@ public enum Components { public var authorAssociation: Components.Schemas.AuthorAssociation /// - Remark: Generated from `#/components/schemas/pull-request-simple/auto_merge`. public var autoMerge: Components.Schemas.AutoMerge? + /// - Remark: Generated from `#/components/schemas/pull-request-simple/stack`. + public var stack: Components.Schemas.PullRequestStack? /// Indicates whether or not the pull request is a draft. /// /// - Remark: Generated from `#/components/schemas/pull-request-simple/draft`. @@ -4378,6 +4458,7 @@ public enum Components { /// - _links: /// - authorAssociation: /// - autoMerge: + /// - stack: /// - draft: Indicates whether or not the pull request is a draft. public init( url: Swift.String, @@ -4415,6 +4496,7 @@ public enum Components { _links: Components.Schemas.PullRequestSimple._LinksPayload, authorAssociation: Components.Schemas.AuthorAssociation, autoMerge: Components.Schemas.AutoMerge? = nil, + stack: Components.Schemas.PullRequestStack? = nil, draft: Swift.Bool? = nil ) { self.url = url @@ -4452,6 +4534,7 @@ public enum Components { self._links = _links self.authorAssociation = authorAssociation self.autoMerge = autoMerge + self.stack = stack self.draft = draft } public enum CodingKeys: String, CodingKey { @@ -4490,6 +4573,7 @@ public enum Components { case _links case authorAssociation = "author_association" case autoMerge = "auto_merge" + case stack case draft } } From dfeb9cdd6b3f18bed2768037ddf291f41aa422f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:51:35 +0000 Subject: [PATCH 18/18] Commit via running: make Sources/agent-tasks --- Sources/agent-tasks/Types.swift | 241 +++++++++++++++++++++++++++++++- 1 file changed, 236 insertions(+), 5 deletions(-) diff --git a/Sources/agent-tasks/Types.swift b/Sources/agent-tasks/Types.swift index a128b7f48d..85759c3736 100644 --- a/Sources/agent-tasks/Types.swift +++ b/Sources/agent-tasks/Types.swift @@ -866,6 +866,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/created_at`. public var createdAt: Foundation.Date + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/custom_agent`. + public struct CustomAgentPayload: Codable, Hashable, Sendable { + /// The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/custom_agent/id`. + public var id: Swift.String? + /// Creates a new `CustomAgentPayload`. + /// + /// - Parameters: + /// - id: The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + public init(id: Swift.String? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/custom_agent`. + public var customAgent: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CustomAgentPayload? /// Creates a new `TasksPayloadPayload`. /// /// - Parameters: @@ -884,6 +907,7 @@ public enum Operations { /// - archivedAt: Timestamp when the task was archived, null if not archived /// - updatedAt: Timestamp of the most recent update /// - createdAt: Timestamp when the task was created + /// - customAgent: Custom agent metadata associated with this task public init( id: Swift.String, url: Swift.String? = nil, @@ -899,7 +923,8 @@ public enum Operations { artifacts: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? = nil, archivedAt: Foundation.Date? = nil, updatedAt: Foundation.Date? = nil, - createdAt: Foundation.Date + createdAt: Foundation.Date, + customAgent: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CustomAgentPayload? = nil ) { self.id = id self.url = url @@ -916,6 +941,7 @@ public enum Operations { self.archivedAt = archivedAt self.updatedAt = updatedAt self.createdAt = createdAt + self.customAgent = customAgent } public enum CodingKeys: String, CodingKey { case id @@ -933,6 +959,7 @@ public enum Operations { case archivedAt = "archived_at" case updatedAt = "updated_at" case createdAt = "created_at" + case customAgent = "custom_agent" } } /// List of tasks @@ -1807,6 +1834,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/model`. public var model: Swift.String? + /// Optional identifier for a custom agent to use for this task. Use the custom agent's filename without the extension - for example, for a `.github/agents/performance-optimizer.agent.md` custom agent, use `performance-optimizer`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/custom_agent`. + public var customAgent: Swift.String? /// Whether to create a PR. /// /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/create_pull_request`. @@ -1824,18 +1855,21 @@ public enum Operations { /// - Parameters: /// - prompt: The user's prompt for the agent /// - model: The model to use for this task. The allowed models may change over time and depend on the user's GitHub Copilot plan and organization policies. Currently supported values: `claude-sonnet-4.6`, `claude-opus-4.6`, `gpt-5.2-codex`, `gpt-5.3-codex`, `gpt-5.4`, `claude-sonnet-4.5`, `claude-opus-4.5` + /// - customAgent: Optional identifier for a custom agent to use for this task. Use the custom agent's filename without the extension - for example, for a `.github/agents/performance-optimizer.agent.md` custom agent, use `performance-optimizer`. /// - createPullRequest: Whether to create a PR. /// - baseRef: Base ref for new branch/PR /// - headRef: Head ref for existing branch/PR. If provided with `base_ref`, the agent looks up open PR context for `head_ref` targeting `base_ref` and commits to `head_ref` instead of creating a new branch. public init( prompt: Swift.String, model: Swift.String? = nil, + customAgent: Swift.String? = nil, createPullRequest: Swift.Bool? = nil, baseRef: Swift.String? = nil, headRef: Swift.String? = nil ) { self.prompt = prompt self.model = model + self.customAgent = customAgent self.createPullRequest = createPullRequest self.baseRef = baseRef self.headRef = headRef @@ -1843,6 +1877,7 @@ public enum Operations { public enum CodingKeys: String, CodingKey { case prompt case model + case customAgent = "custom_agent" case createPullRequest = "create_pull_request" case baseRef = "base_ref" case headRef = "head_ref" @@ -2219,6 +2254,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/created_at`. public var createdAt: Foundation.Date + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/custom_agent`. + public struct CustomAgentPayload: Codable, Hashable, Sendable { + /// The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/custom_agent/id`. + public var id: Swift.String? + /// Creates a new `CustomAgentPayload`. + /// + /// - Parameters: + /// - id: The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + public init(id: Swift.String? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/custom_agent`. + public var customAgent: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.CustomAgentPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -2237,6 +2295,7 @@ public enum Operations { /// - archivedAt: Timestamp when the task was archived, null if not archived /// - updatedAt: Timestamp of the most recent update /// - createdAt: Timestamp when the task was created + /// - customAgent: Custom agent metadata associated with this task public init( id: Swift.String, url: Swift.String? = nil, @@ -2252,7 +2311,8 @@ public enum Operations { artifacts: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.ArtifactsPayload? = nil, archivedAt: Foundation.Date? = nil, updatedAt: Foundation.Date? = nil, - createdAt: Foundation.Date + createdAt: Foundation.Date, + customAgent: Operations.AgentTasksCreateTaskInRepo.Output.Created.Body.JsonPayload.CustomAgentPayload? = nil ) { self.id = id self.url = url @@ -2269,6 +2329,7 @@ public enum Operations { self.archivedAt = archivedAt self.updatedAt = updatedAt self.createdAt = createdAt + self.customAgent = customAgent } public enum CodingKeys: String, CodingKey { case id @@ -2286,6 +2347,7 @@ public enum Operations { case archivedAt = "archived_at" case updatedAt = "updated_at" case createdAt = "created_at" + case customAgent = "custom_agent" } } /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/application\/json`. @@ -3342,6 +3404,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/created_at`. public var createdAt: Foundation.Date + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/custom_agent`. + public struct CustomAgentPayload: Codable, Hashable, Sendable { + /// The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/custom_agent/id`. + public var id: Swift.String? + /// Creates a new `CustomAgentPayload`. + /// + /// - Parameters: + /// - id: The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + public init(id: Swift.String? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/custom_agent`. + public var customAgent: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CustomAgentPayload? /// Creates a new `Value1Payload`. /// /// - Parameters: @@ -3360,6 +3445,7 @@ public enum Operations { /// - archivedAt: Timestamp when the task was archived, null if not archived /// - updatedAt: Timestamp of the most recent update /// - createdAt: Timestamp when the task was created + /// - customAgent: Custom agent metadata associated with this task public init( id: Swift.String, url: Swift.String? = nil, @@ -3375,7 +3461,8 @@ public enum Operations { artifacts: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? = nil, archivedAt: Foundation.Date? = nil, updatedAt: Foundation.Date? = nil, - createdAt: Foundation.Date + createdAt: Foundation.Date, + customAgent: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CustomAgentPayload? = nil ) { self.id = id self.url = url @@ -3392,6 +3479,7 @@ public enum Operations { self.archivedAt = archivedAt self.updatedAt = updatedAt self.createdAt = createdAt + self.customAgent = customAgent } public enum CodingKeys: String, CodingKey { case id @@ -3409,6 +3497,7 @@ public enum Operations { case archivedAt = "archived_at" case updatedAt = "updated_at" case createdAt = "created_at" + case customAgent = "custom_agent" } } /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1`. @@ -3545,6 +3634,46 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/model`. public var model: Swift.String? + /// Structured information about billing units consumed by the session. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage`. + public struct UsagePayload: Codable, Hashable, Sendable { + /// Billing unit used for this session. New sessions since June 1, 2026 use `ai_credits`, but older sessions use `premium_requests`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case aiCredits = "ai_credits" + case premiumRequests = "premium_requests" + } + /// Billing unit used for this session. New sessions since June 1, 2026 use `ai_credits`, but older sessions use `premium_requests`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage/type`. + public var _type: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload._TypePayload + /// Number of billing units used by this session. When the `type` is `ai_credits`, the value is a whole number, expressed in nano units. When presenting this to a human, divide by 1,000,000,000 and round to one decimal place. When aggregating (for example, summing usage across sessions), sum the nano values first, and divide once at the end before presenting to a human to avoid losing precision. When the `type` is `premium_requests`, the value may be fractional (for example `1.5`). + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage/amount`. + public var amount: Swift.Double + /// Creates a new `UsagePayload`. + /// + /// - Parameters: + /// - _type: Billing unit used for this session. New sessions since June 1, 2026 use `ai_credits`, but older sessions use `premium_requests`. + /// - amount: Number of billing units used by this session. When the `type` is `ai_credits`, the value is a whole number, expressed in nano units. When presenting this to a human, divide by 1,000,000,000 and round to one decimal place. When aggregating (for example, summing usage across sessions), sum the nano values first, and divide once at the end before presenting to a human to avoid losing precision. When the `type` is `premium_requests`, the value may be fractional (for example `1.5`). + public init( + _type: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload._TypePayload, + amount: Swift.Double + ) { + self._type = _type + self.amount = amount + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case amount + } + } + /// Structured information about billing units consumed by the session. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage`. + public var usage: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload? /// Error details for a failed session /// /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. @@ -3585,6 +3714,7 @@ public enum Operations { /// - headRef: Head branch name /// - baseRef: Base branch name /// - model: Model used for this session + /// - usage: Structured information about billing units consumed by the session. /// - error: Error details for a failed session public init( id: Swift.String, @@ -3601,6 +3731,7 @@ public enum Operations { headRef: Swift.String? = nil, baseRef: Swift.String? = nil, model: Swift.String? = nil, + usage: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload? = nil, error: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? = nil ) { self.id = id @@ -3617,6 +3748,7 @@ public enum Operations { self.headRef = headRef self.baseRef = baseRef self.model = model + self.usage = usage self.error = error } public enum CodingKeys: String, CodingKey { @@ -3634,6 +3766,7 @@ public enum Operations { case headRef = "head_ref" case baseRef = "base_ref" case model + case usage case error } } @@ -4924,6 +5057,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/created_at`. public var createdAt: Foundation.Date + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/custom_agent`. + public struct CustomAgentPayload: Codable, Hashable, Sendable { + /// The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/custom_agent/id`. + public var id: Swift.String? + /// Creates a new `CustomAgentPayload`. + /// + /// - Parameters: + /// - id: The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + public init(id: Swift.String? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/custom_agent`. + public var customAgent: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CustomAgentPayload? /// Creates a new `TasksPayloadPayload`. /// /// - Parameters: @@ -4942,6 +5098,7 @@ public enum Operations { /// - archivedAt: Timestamp when the task was archived, null if not archived /// - updatedAt: Timestamp of the most recent update /// - createdAt: Timestamp when the task was created + /// - customAgent: Custom agent metadata associated with this task public init( id: Swift.String, url: Swift.String? = nil, @@ -4957,7 +5114,8 @@ public enum Operations { artifacts: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? = nil, archivedAt: Foundation.Date? = nil, updatedAt: Foundation.Date? = nil, - createdAt: Foundation.Date + createdAt: Foundation.Date, + customAgent: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CustomAgentPayload? = nil ) { self.id = id self.url = url @@ -4974,6 +5132,7 @@ public enum Operations { self.archivedAt = archivedAt self.updatedAt = updatedAt self.createdAt = createdAt + self.customAgent = customAgent } public enum CodingKeys: String, CodingKey { case id @@ -4991,6 +5150,7 @@ public enum Operations { case archivedAt = "archived_at" case updatedAt = "updated_at" case createdAt = "created_at" + case customAgent = "custom_agent" } } /// List of tasks @@ -6073,6 +6233,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/created_at`. public var createdAt: Foundation.Date + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/custom_agent`. + public struct CustomAgentPayload: Codable, Hashable, Sendable { + /// The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/custom_agent/id`. + public var id: Swift.String? + /// Creates a new `CustomAgentPayload`. + /// + /// - Parameters: + /// - id: The custom agent's filename without the extension - for example, `performance-optimizer` for a `.github/agents/performance-optimizer.agent.md` custom agent. + public init(id: Swift.String? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// Custom agent metadata associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/custom_agent`. + public var customAgent: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CustomAgentPayload? /// Creates a new `Value1Payload`. /// /// - Parameters: @@ -6091,6 +6274,7 @@ public enum Operations { /// - archivedAt: Timestamp when the task was archived, null if not archived /// - updatedAt: Timestamp of the most recent update /// - createdAt: Timestamp when the task was created + /// - customAgent: Custom agent metadata associated with this task public init( id: Swift.String, url: Swift.String? = nil, @@ -6106,7 +6290,8 @@ public enum Operations { artifacts: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? = nil, archivedAt: Foundation.Date? = nil, updatedAt: Foundation.Date? = nil, - createdAt: Foundation.Date + createdAt: Foundation.Date, + customAgent: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CustomAgentPayload? = nil ) { self.id = id self.url = url @@ -6123,6 +6308,7 @@ public enum Operations { self.archivedAt = archivedAt self.updatedAt = updatedAt self.createdAt = createdAt + self.customAgent = customAgent } public enum CodingKeys: String, CodingKey { case id @@ -6140,6 +6326,7 @@ public enum Operations { case archivedAt = "archived_at" case updatedAt = "updated_at" case createdAt = "created_at" + case customAgent = "custom_agent" } } /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1`. @@ -6276,6 +6463,46 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/model`. public var model: Swift.String? + /// Structured information about billing units consumed by the session. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage`. + public struct UsagePayload: Codable, Hashable, Sendable { + /// Billing unit used for this session. New sessions since June 1, 2026 use `ai_credits`, but older sessions use `premium_requests`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case aiCredits = "ai_credits" + case premiumRequests = "premium_requests" + } + /// Billing unit used for this session. New sessions since June 1, 2026 use `ai_credits`, but older sessions use `premium_requests`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage/type`. + public var _type: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload._TypePayload + /// Number of billing units used by this session. When the `type` is `ai_credits`, the value is a whole number, expressed in nano units. When presenting this to a human, divide by 1,000,000,000 and round to one decimal place. When aggregating (for example, summing usage across sessions), sum the nano values first, and divide once at the end before presenting to a human to avoid losing precision. When the `type` is `premium_requests`, the value may be fractional (for example `1.5`). + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage/amount`. + public var amount: Swift.Double + /// Creates a new `UsagePayload`. + /// + /// - Parameters: + /// - _type: Billing unit used for this session. New sessions since June 1, 2026 use `ai_credits`, but older sessions use `premium_requests`. + /// - amount: Number of billing units used by this session. When the `type` is `ai_credits`, the value is a whole number, expressed in nano units. When presenting this to a human, divide by 1,000,000,000 and round to one decimal place. When aggregating (for example, summing usage across sessions), sum the nano values first, and divide once at the end before presenting to a human to avoid losing precision. When the `type` is `premium_requests`, the value may be fractional (for example `1.5`). + public init( + _type: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload._TypePayload, + amount: Swift.Double + ) { + self._type = _type + self.amount = amount + } + public enum CodingKeys: String, CodingKey { + case _type = "type" + case amount + } + } + /// Structured information about billing units consumed by the session. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/usage`. + public var usage: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload? /// Error details for a failed session /// /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. @@ -6316,6 +6543,7 @@ public enum Operations { /// - headRef: Head branch name /// - baseRef: Base branch name /// - model: Model used for this session + /// - usage: Structured information about billing units consumed by the session. /// - error: Error details for a failed session public init( id: Swift.String, @@ -6332,6 +6560,7 @@ public enum Operations { headRef: Swift.String? = nil, baseRef: Swift.String? = nil, model: Swift.String? = nil, + usage: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UsagePayload? = nil, error: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? = nil ) { self.id = id @@ -6348,6 +6577,7 @@ public enum Operations { self.headRef = headRef self.baseRef = baseRef self.model = model + self.usage = usage self.error = error } public enum CodingKeys: String, CodingKey { @@ -6365,6 +6595,7 @@ public enum Operations { case headRef = "head_ref" case baseRef = "base_ref" case model + case usage case error } }