From 78bf80fad107e72ccd282ffc20114aadd9e8d9b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 21:26:21 +0000 Subject: [PATCH 01/27] Bump Submodule/github/rest-api-description from `d5aff63` to `758e552` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `d5aff63` to `758e552`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/d5aff63ff6b7c16e6342dc83ee3f03bac27eef23...758e5523c8b6082bdd547cef042b884229a0355c) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: 758e5523c8b6082bdd547cef042b884229a0355c 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 d5aff63ff6..758e5523c8 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit d5aff63ff6b7c16e6342dc83ee3f03bac27eef23 +Subproject commit 758e5523c8b6082bdd547cef042b884229a0355c From ed4822a8ac6787f2fd2ecf4260b23c234de60c7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:47:55 +0000 Subject: [PATCH 02/27] Commit via running: make Sources/actions --- Sources/actions/Types.swift | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Sources/actions/Types.swift b/Sources/actions/Types.swift index 5e867feda2..9b7cf2bd3c 100644 --- a/Sources/actions/Types.swift +++ b/Sources/actions/Types.swift @@ -6209,10 +6209,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -6460,7 +6456,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -6560,7 +6555,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -6660,7 +6654,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -6761,7 +6754,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -7751,8 +7743,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -7971,7 +7961,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -8063,7 +8052,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -8155,7 +8143,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -8248,7 +8235,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From adbd96ca1dd9d701b95d8838d263421fff5d5171 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:48:17 +0000 Subject: [PATCH 03/27] Commit via running: make Sources/activity --- Sources/activity/Types.swift | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Sources/activity/Types.swift b/Sources/activity/Types.swift index 49268fe9bc..d8634153ba 100644 --- a/Sources/activity/Types.swift +++ b/Sources/activity/Types.swift @@ -1659,10 +1659,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1910,7 +1906,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -2010,7 +2005,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2110,7 +2104,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2211,7 +2204,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -5811,8 +5803,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -6031,7 +6021,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -6123,7 +6112,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -6215,7 +6203,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -6308,7 +6295,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -6920,8 +6906,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/fork-event/forkee/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.ForkEvent.ForkeePayload.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/fork-event/forkee/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/fork-event/forkee/forks_count`. public var forksCount: Swift.Int? /// - Remark: Generated from `#/components/schemas/fork-event/forkee/mirror_url`. @@ -7023,7 +7007,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - forksCount: /// - mirrorUrl: /// - archived: @@ -7107,7 +7090,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.ForkEvent.ForkeePayload.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, forksCount: Swift.Int? = nil, mirrorUrl: Swift.String? = nil, archived: Swift.Bool? = nil, @@ -7191,7 +7173,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.forksCount = forksCount self.mirrorUrl = mirrorUrl self.archived = archived @@ -7276,7 +7257,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case forksCount = "forks_count" case mirrorUrl = "mirror_url" case archived From 00f5d0e872ed923d1755c9884085baf2a91e6fbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:48:40 +0000 Subject: [PATCH 04/27] Commit via running: make Sources/apps --- Sources/apps/Client.swift | 11 +++++++++-- Sources/apps/Types.swift | 41 +++++++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/Sources/apps/Client.swift b/Sources/apps/Client.swift index 16f3ae909a..fdcdfef136 100644 --- a/Sources/apps/Client.swift +++ b/Sources/apps/Client.swift @@ -383,6 +383,13 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "status", + value: input.query.status + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -3363,7 +3370,7 @@ public struct Client: APIProtocol { } /// Add a repository to an app installation /// - /// Add a single repository to an installation. The authenticated user must have admin access to the repository. + /// Add a single repository to an installation. The authenticated user must have admin access to the repository. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// @@ -3456,7 +3463,7 @@ public struct Client: APIProtocol { } /// Remove a repository from an app installation /// - /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. + /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index 4248129919..619b2d00a6 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -297,7 +297,7 @@ public protocol APIProtocol: Sendable { func appsListInstallationReposForAuthenticatedUser(_ input: Operations.AppsListInstallationReposForAuthenticatedUser.Input) async throws -> Operations.AppsListInstallationReposForAuthenticatedUser.Output /// Add a repository to an app installation /// - /// Add a single repository to an installation. The authenticated user must have admin access to the repository. + /// Add a single repository to an installation. The authenticated user must have admin access to the repository. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// @@ -306,7 +306,7 @@ public protocol APIProtocol: Sendable { func appsAddRepoToInstallationForAuthenticatedUser(_ input: Operations.AppsAddRepoToInstallationForAuthenticatedUser.Input) async throws -> Operations.AppsAddRepoToInstallationForAuthenticatedUser.Output /// Remove a repository from an app installation /// - /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. + /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// @@ -882,7 +882,7 @@ extension APIProtocol { } /// Add a repository to an app installation /// - /// Add a single repository to an installation. The authenticated user must have admin access to the repository. + /// Add a single repository to an installation. The authenticated user must have admin access to the repository. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// @@ -899,7 +899,7 @@ extension APIProtocol { } /// Remove a repository from an app installation /// - /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. + /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// @@ -3666,10 +3666,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -3917,7 +3913,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -4017,7 +4012,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -4117,7 +4111,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4218,7 +4211,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4892,6 +4884,13 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/cursor`. public typealias Cursor = Swift.String + /// Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). + /// + /// - Remark: Generated from `#/components/parameters/webhook-delivery-status`. + @frozen public enum WebhookDeliveryStatus: String, Codable, Hashable, Sendable, CaseIterable { + case success = "success" + case failure = "failure" + } /// - Remark: Generated from `#/components/parameters/delivery-id`. public typealias DeliveryId = 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)." @@ -5911,17 +5910,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/app/hook/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.Cursor? + /// - Remark: Generated from `#/components/parameters/webhook-delivery-status`. + @frozen public enum WebhookDeliveryStatus: String, Codable, Hashable, Sendable, CaseIterable { + case success = "success" + case failure = "failure" + } + /// Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). + /// + /// - Remark: Generated from `#/paths/app/hook/deliveries/GET/query/status`. + public var status: Components.Parameters.WebhookDeliveryStatus? /// 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)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// - status: Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). public init( perPage: Components.Parameters.PerPage? = nil, - cursor: Components.Parameters.Cursor? = nil + cursor: Components.Parameters.Cursor? = nil, + status: Components.Parameters.WebhookDeliveryStatus? = nil ) { self.perPage = perPage self.cursor = cursor + self.status = status } } public var query: Operations.AppsListWebhookDeliveries.Input.Query @@ -11365,7 +11376,7 @@ public enum Operations { } /// Add a repository to an app installation /// - /// Add a single repository to an installation. The authenticated user must have admin access to the repository. + /// Add a single repository to an installation. The authenticated user must have admin access to the repository. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// @@ -11569,7 +11580,7 @@ public enum Operations { } /// Remove a repository from an app installation /// - /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. + /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. /// /// This endpoint only works for PATs (classic) with the `repo` scope. /// From 88c694f79fe8187412d95a516e9f5e6d9f2e185a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:49:24 +0000 Subject: [PATCH 05/27] Commit via running: make Sources/checks --- Sources/checks/Types.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index 589804622f..bbec88505b 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -1606,8 +1606,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -1826,7 +1824,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -1918,7 +1915,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -2010,7 +2006,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2103,7 +2098,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 41043cf494596a52e17aa4dff390f8a3fec967e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:49:46 +0000 Subject: [PATCH 06/27] Commit via running: make Sources/code-scanning --- Sources/code-scanning/Types.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index 99b5c8fbbd..be3144be13 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -1951,15 +1951,25 @@ public enum Components { public struct MessagePayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance/message/text`. public var text: Swift.String? + /// The message text as GitHub-flavored Markdown, with placeholder links for related locations replaced by links to the relevant code. Only populated when related locations are available for the alert instance. + /// + /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance/message/markdown`. + public var markdown: Swift.String? /// Creates a new `MessagePayload`. /// /// - Parameters: /// - text: - public init(text: Swift.String? = nil) { + /// - markdown: The message text as GitHub-flavored Markdown, with placeholder links for related locations replaced by links to the relevant code. Only populated when related locations are available for the alert instance. + public init( + text: Swift.String? = nil, + markdown: Swift.String? = nil + ) { self.text = text + self.markdown = markdown } public enum CodingKeys: String, CodingKey { case text + case markdown } } /// - Remark: Generated from `#/components/schemas/code-scanning-alert-instance/message`. From b12d287d25548b22f5127dae91252f5a16a3b515 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:50:52 +0000 Subject: [PATCH 07/27] Commit via running: make Sources/dependabot --- Sources/dependabot/Client.swift | 21 ++++++++++++ Sources/dependabot/Types.swift | 61 +++++++++++++++++++++++++++++---- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/Sources/dependabot/Client.swift b/Sources/dependabot/Client.swift index 00cb59268a..e69707b601 100644 --- a/Sources/dependabot/Client.swift +++ b/Sources/dependabot/Client.swift @@ -66,6 +66,13 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "classification", + value: input.query.classification + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -630,6 +637,13 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "classification", + value: input.query.classification + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -1483,6 +1497,13 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "classification", + value: input.query.classification + ) try converter.setQueryItemAsURI( in: &request, style: .form, diff --git a/Sources/dependabot/Types.swift b/Sources/dependabot/Types.swift index 5bf3e69d08..5d00c226b8 100644 --- a/Sources/dependabot/Types.swift +++ b/Sources/dependabot/Types.swift @@ -1796,6 +1796,17 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/severity`. public var severity: Components.Schemas.DependabotAlertSecurityAdvisory.SeverityPayload + /// The classification of the advisory. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/classification`. + @frozen public enum ClassificationPayload: String, Codable, Hashable, Sendable, CaseIterable { + case general = "general" + case malware = "malware" + } + /// The classification of the advisory. + /// + /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/classification`. + public var classification: Components.Schemas.DependabotAlertSecurityAdvisory.ClassificationPayload? /// Details for the advisory pertaining to the Common Vulnerability Scoring System. /// /// - Remark: Generated from `#/components/schemas/dependabot-alert-security-advisory/cvss`. @@ -2017,6 +2028,7 @@ public enum Components { /// - description: A long-form Markdown-supported description of the advisory. /// - vulnerabilities: Vulnerable version range information for the advisory. /// - severity: The severity of the advisory. + /// - classification: The classification of the advisory. /// - cvss: Details for the advisory pertaining to the Common Vulnerability Scoring System. /// - cvssSeverities: /// - epss: @@ -2033,6 +2045,7 @@ public enum Components { description: Swift.String, vulnerabilities: [Components.Schemas.DependabotAlertSecurityVulnerability], severity: Components.Schemas.DependabotAlertSecurityAdvisory.SeverityPayload, + classification: Components.Schemas.DependabotAlertSecurityAdvisory.ClassificationPayload? = nil, cvss: Components.Schemas.DependabotAlertSecurityAdvisory.CvssPayload, cvssSeverities: Components.Schemas.CvssSeverities? = nil, epss: Components.Schemas.SecurityAdvisoryEpss? = nil, @@ -2049,6 +2062,7 @@ public enum Components { self.description = description self.vulnerabilities = vulnerabilities self.severity = severity + self.classification = classification self.cvss = cvss self.cvssSeverities = cvssSeverities self.epss = epss @@ -2066,6 +2080,7 @@ public enum Components { case description case vulnerabilities case severity + case classification case cvss case cvssSeverities = "cvss_severities" case epss @@ -2102,6 +2117,10 @@ public enum Components { Components.Schemas.DependabotAlertSecurityAdvisory.SeverityPayload.self, forKey: .severity ) + self.classification = try container.decodeIfPresent( + Components.Schemas.DependabotAlertSecurityAdvisory.ClassificationPayload.self, + forKey: .classification + ) self.cvss = try container.decode( Components.Schemas.DependabotAlertSecurityAdvisory.CvssPayload.self, forKey: .cvss @@ -2145,6 +2164,7 @@ public enum Components { "description", "vulnerabilities", "severity", + "classification", "cvss", "cvss_severities", "epss", @@ -2327,6 +2347,7 @@ public enum Components { case unknown = "unknown" case direct = "direct" case transitive = "transitive" + case inconclusive = "inconclusive" } /// The vulnerable dependency's relationship to your project. /// @@ -3064,8 +3085,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -3284,7 +3303,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -3376,7 +3394,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3468,7 +3485,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3561,7 +3577,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4158,6 +4173,7 @@ public enum Components { case unknown = "unknown" case direct = "direct" case transitive = "transitive" + case inconclusive = "inconclusive" } /// The vulnerable dependency's relationship to your project. /// @@ -4470,6 +4486,12 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/enterprise`. public typealias Enterprise = Swift.String + /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. + /// + /// Can be: `malware`, `general` + /// + /// - Remark: Generated from `#/components/parameters/dependabot-alert-comma-separated-classifications`. + public typealias DependabotAlertCommaSeparatedClassifications = Swift.String /// A comma-separated list of states. If specified, only alerts with these states will be returned. /// /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` @@ -4872,6 +4894,12 @@ public enum Operations { public var path: Operations.DependabotListAlertsForEnterprise.Input.Path /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query`. public struct Query: Sendable, Hashable { + /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. + /// + /// Can be: `malware`, `general` + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/dependabot/alerts/GET/query/classification`. + public var classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? /// A comma-separated list of states. If specified, only alerts with these states will be returned. /// /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` @@ -5001,6 +5029,7 @@ public enum Operations { /// Creates a new `Query`. /// /// - Parameters: + /// - classification: A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. /// - state: A comma-separated list of states. If specified, only alerts with these states will be returned. /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. @@ -5015,6 +5044,7 @@ public enum Operations { /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( + classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? = nil, state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, @@ -5029,6 +5059,7 @@ public enum Operations { after: Components.Parameters.PaginationAfter? = nil, perPage: Components.Parameters.PerPage? = nil ) { + self.classification = classification self.state = state self.severity = severity self.ecosystem = ecosystem @@ -5905,6 +5936,12 @@ public enum Operations { public var path: Operations.DependabotListAlertsForOrg.Input.Path /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query`. public struct Query: Sendable, Hashable { + /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. + /// + /// Can be: `malware`, `general` + /// + /// - Remark: Generated from `#/paths/orgs/{org}/dependabot/alerts/GET/query/classification`. + public var classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? /// A comma-separated list of states. If specified, only alerts with these states will be returned. /// /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` @@ -6051,6 +6088,7 @@ public enum Operations { /// Creates a new `Query`. /// /// - Parameters: + /// - classification: A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. /// - state: A comma-separated list of states. If specified, only alerts with these states will be returned. /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. @@ -6068,6 +6106,7 @@ public enum Operations { /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( + classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? = nil, state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, @@ -6085,6 +6124,7 @@ public enum Operations { after: Components.Parameters.PaginationAfter? = nil, perPage: Components.Parameters.PerPage? = nil ) { + self.classification = classification self.state = state self.severity = severity self.ecosystem = ecosystem @@ -7799,6 +7839,12 @@ public enum Operations { public var path: Operations.DependabotListAlertsForRepo.Input.Path /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query`. public struct Query: Sendable, Hashable { + /// A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. + /// + /// Can be: `malware`, `general` + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/dependabot/alerts/GET/query/classification`. + public var classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? /// A comma-separated list of states. If specified, only alerts with these states will be returned. /// /// Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` @@ -7932,6 +7978,7 @@ public enum Operations { /// Creates a new `Query`. /// /// - Parameters: + /// - classification: A comma-separated list of vulnerability classifications. If specified, only alerts for vulnerabilities with these classifications will be returned. /// - state: A comma-separated list of states. If specified, only alerts with these states will be returned. /// - severity: A comma-separated list of severities. If specified, only alerts with these severities will be returned. /// - ecosystem: A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned. @@ -7947,6 +7994,7 @@ public enum Operations { /// - after: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." public init( + classification: Components.Parameters.DependabotAlertCommaSeparatedClassifications? = nil, state: Components.Parameters.DependabotAlertCommaSeparatedStates? = nil, severity: Components.Parameters.DependabotAlertCommaSeparatedSeverities? = nil, ecosystem: Components.Parameters.DependabotAlertCommaSeparatedEcosystems? = nil, @@ -7962,6 +8010,7 @@ public enum Operations { after: Components.Parameters.PaginationAfter? = nil, perPage: Components.Parameters.PerPage? = nil ) { + self.classification = classification self.state = state self.severity = severity self.ecosystem = ecosystem From 7e12bc804f103ff7945c51941834b45fb78a4c5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:52:42 +0000 Subject: [PATCH 08/27] Commit via running: make Sources/issues --- Sources/issues/Types.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Sources/issues/Types.swift b/Sources/issues/Types.swift index 07bb63916b..8e395b1189 100644 --- a/Sources/issues/Types.swift +++ b/Sources/issues/Types.swift @@ -2911,10 +2911,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -3162,7 +3158,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -3262,7 +3257,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -3362,7 +3356,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3463,7 +3456,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 795bdfc9e393b9ed564ad91b1679e612c9110bf0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:54:31 +0000 Subject: [PATCH 09/27] Commit via running: make Sources/migrations --- Sources/migrations/Types.swift | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Sources/migrations/Types.swift b/Sources/migrations/Types.swift index 08d3099b87..4bd956c5bc 100644 --- a/Sources/migrations/Types.swift +++ b/Sources/migrations/Types.swift @@ -1500,10 +1500,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1751,7 +1747,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -1851,7 +1846,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -1951,7 +1945,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2052,7 +2045,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -2601,8 +2593,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -2821,7 +2811,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -2913,7 +2902,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3005,7 +2993,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3098,7 +3085,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 248fbec36fe6004531467a50920d8f983c33b8f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:54:54 +0000 Subject: [PATCH 10/27] Commit via running: make Sources/oidc --- Sources/oidc/Types.swift | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Sources/oidc/Types.swift b/Sources/oidc/Types.swift index 060c0167e6..b87f553e15 100644 --- a/Sources/oidc/Types.swift +++ b/Sources/oidc/Types.swift @@ -1900,8 +1900,27 @@ public enum Operations { public var headers: Operations.OidcUpdateOidcCustomSubTemplateForOrg.Input.Headers /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/sub/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { + /// Actions OIDC Subject customization + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/sub/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/sub/PUT/requestBody/json/include_claim_keys`. + public var includeClaimKeys: [Swift.String]? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - includeClaimKeys: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + public init(includeClaimKeys: [Swift.String]? = nil) { + self.includeClaimKeys = includeClaimKeys + } + public enum CodingKeys: String, CodingKey { + case includeClaimKeys = "include_claim_keys" + } + } /// - Remark: Generated from `#/paths/orgs/{org}/actions/oidc/customization/sub/PUT/requestBody/content/application\/json`. - case json(Components.Schemas.OidcCustomSub) + case json(Operations.OidcUpdateOidcCustomSubTemplateForOrg.Input.Body.JsonPayload) } public var body: Operations.OidcUpdateOidcCustomSubTemplateForOrg.Input.Body /// Creates a new `Input`. From c8b852ab3eb9df91a5d591d3d037f3419c3cf045 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:55:17 +0000 Subject: [PATCH 11/27] Commit via running: make Sources/orgs --- Sources/orgs/Client.swift | 143 +++++++++++++++++++++- Sources/orgs/Types.swift | 250 ++++++++++++++++++++++++++++++++++---- 2 files changed, 369 insertions(+), 24 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index bd142e9956..572e09b97e 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -537,6 +537,50 @@ public struct Client: APIProtocol { 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, @@ -614,6 +658,50 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .ok(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.OrgsSetClusterDeploymentRecords.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: 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, @@ -689,6 +777,50 @@ public struct Client: APIProtocol { 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, @@ -2447,6 +2579,13 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "status", + value: input.query.status + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -5668,7 +5807,7 @@ public struct Client: APIProtocol { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -6065,7 +6204,7 @@ public struct Client: APIProtocol { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 909d7be624..897f22566f 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -606,7 +606,7 @@ public protocol APIProtocol: Sendable { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -686,7 +686,7 @@ public protocol APIProtocol: Sendable { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -2196,7 +2196,7 @@ extension APIProtocol { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -2296,7 +2296,7 @@ extension APIProtocol { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -5811,8 +5811,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -6031,7 +6029,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -6123,7 +6120,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -6215,7 +6211,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -6308,7 +6303,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -9883,6 +9877,13 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/cursor`. public typealias Cursor = Swift.String + /// Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). + /// + /// - Remark: Generated from `#/components/parameters/webhook-delivery-status`. + @frozen public enum WebhookDeliveryStatus: String, Codable, Hashable, Sendable, CaseIterable { + case success = "success" + case failure = "failure" + } /// - Remark: Generated from `#/components/parameters/delivery-id`. public typealias DeliveryId = 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)." @@ -11584,6 +11585,11 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/github_repository`. public var githubRepository: Swift.String? + /// If true, the endpoint will return the created or updated record in the response body. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/json/return_records`. + public var returnRecords: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -11598,6 +11604,7 @@ public enum Operations { /// - tags: The tags associated with the deployment. /// - runtimeRisks: A list of runtime risks associated with the deployment. /// - githubRepository: The name of the GitHub repository associated with the artifact. This should be used + /// - returnRecords: If true, the endpoint will return the created or updated record in the response body. public init( name: Swift.String, digest: Swift.String, @@ -11609,7 +11616,8 @@ public enum Operations { deploymentName: Swift.String, tags: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.TagsPayload? = nil, runtimeRisks: Operations.OrgsCreateArtifactDeploymentRecord.Input.Body.JsonPayload.RuntimeRisksPayload? = nil, - githubRepository: Swift.String? = nil + githubRepository: Swift.String? = nil, + returnRecords: Swift.Bool? = nil ) { self.name = name self.digest = digest @@ -11622,6 +11630,7 @@ public enum Operations { self.tags = tags self.runtimeRisks = runtimeRisks self.githubRepository = githubRepository + self.returnRecords = returnRecords } public enum CodingKeys: String, CodingKey { case name @@ -11635,6 +11644,7 @@ public enum Operations { case tags case runtimeRisks = "runtime_risks" case githubRepository = "github_repository" + case returnRecords = "return_records" } } /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/requestBody/content/application\/json`. @@ -11666,7 +11676,7 @@ public enum Operations { /// The number of deployment records created /// /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/responses/200/content/json/total_count`. - public var totalCount: Swift.Int? + public var totalCount: Swift.Int /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/POST/responses/200/content/json/deployment_records`. public var deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? /// Creates a new `JsonPayload`. @@ -11675,7 +11685,7 @@ public enum Operations { /// - totalCount: The number of deployment records created /// - deploymentRecords: public init( - totalCount: Swift.Int? = nil, + totalCount: Swift.Int, deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil ) { self.totalCount = totalCount @@ -11734,6 +11744,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/deployment-record/post(orgs/create-artifact-deployment-record)/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}/artifacts/metadata/deployment-record/post(orgs/create-artifact-deployment-record)/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. @@ -11961,25 +12017,34 @@ 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 + /// If true, the endpoint will return the set records in the response body + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/json/return_records`. + public var returnRecords: Swift.Bool? /// 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. + /// - 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 + deployments: Operations.OrgsSetClusterDeploymentRecords.Input.Body.JsonPayload.DeploymentsPayload, + returnRecords: Swift.Bool? = nil ) { self.logicalEnvironment = logicalEnvironment self.physicalEnvironment = physicalEnvironment self.deployments = deployments + self.returnRecords = returnRecords } public enum CodingKeys: String, CodingKey { case logicalEnvironment = "logical_environment" case physicalEnvironment = "physical_environment" case deployments + case returnRecords = "return_records" } } /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}/POST/requestBody/content/application\/json`. @@ -12011,7 +12076,7 @@ public enum Operations { /// 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? + 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`. @@ -12020,7 +12085,7 @@ public enum Operations { /// - totalCount: The number of deployment records created /// - deploymentRecords: public init( - totalCount: Swift.Int? = nil, + totalCount: Swift.Int, deploymentRecords: [Components.Schemas.ArtifactDeploymentRecord]? = nil ) { self.totalCount = totalCount @@ -12080,6 +12145,80 @@ 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 + ) + } + } + } + /// 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(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. @@ -12202,6 +12341,11 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/github_repository`. public var githubRepository: Swift.String? + /// If true, the endpoint will return the created record in the response body. + /// + /// + /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/json/return_records`. + public var returnRecords: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -12214,6 +12358,7 @@ public enum Operations { /// - repository: The repository name within the registry. /// - status: The status of the artifact (e.g., active, inactive). /// - githubRepository: The name of the GitHub repository associated with the artifact. This should be used + /// - returnRecords: If true, the endpoint will return the created record in the response body. public init( name: Swift.String, digest: Swift.String, @@ -12223,7 +12368,8 @@ public enum Operations { registryUrl: Swift.String, repository: Swift.String? = nil, status: Operations.OrgsCreateArtifactStorageRecord.Input.Body.JsonPayload.StatusPayload? = nil, - githubRepository: Swift.String? = nil + githubRepository: Swift.String? = nil, + returnRecords: Swift.Bool? = nil ) { self.name = name self.digest = digest @@ -12234,6 +12380,7 @@ public enum Operations { self.repository = repository self.status = status self.githubRepository = githubRepository + self.returnRecords = returnRecords } public enum CodingKeys: String, CodingKey { case name @@ -12245,6 +12392,7 @@ public enum Operations { case repository case status case githubRepository = "github_repository" + case returnRecords = "return_records" } } /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/requestBody/content/application\/json`. @@ -12274,7 +12422,7 @@ public enum Operations { /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/total_count`. - public var totalCount: Swift.Int? + public var totalCount: Swift.Int /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload`. public struct StorageRecordsPayloadPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/paths/orgs/{org}/artifacts/metadata/storage-record/POST/responses/200/content/json/StorageRecordsPayload/id`. @@ -12350,7 +12498,7 @@ public enum Operations { /// - totalCount: /// - storageRecords: public init( - totalCount: Swift.Int? = nil, + totalCount: Swift.Int, storageRecords: Operations.OrgsCreateArtifactStorageRecord.Output.Ok.Body.JsonPayload.StorageRecordsPayload? = nil ) { self.totalCount = totalCount @@ -12409,6 +12557,52 @@ public enum Operations { } } } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)/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}/artifacts/metadata/storage-record/post(orgs/create-artifact-storage-record)/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. @@ -16627,17 +16821,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.Cursor? + /// - Remark: Generated from `#/components/parameters/webhook-delivery-status`. + @frozen public enum WebhookDeliveryStatus: String, Codable, Hashable, Sendable, CaseIterable { + case success = "success" + case failure = "failure" + } + /// Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/status`. + public var status: Components.Parameters.WebhookDeliveryStatus? /// 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)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// - status: Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). public init( perPage: Components.Parameters.PerPage? = nil, - cursor: Components.Parameters.Cursor? = nil + cursor: Components.Parameters.Cursor? = nil, + status: Components.Parameters.WebhookDeliveryStatus? = nil ) { self.perPage = perPage self.cursor = cursor + self.status = status } } public var query: Operations.OrgsListWebhookDeliveries.Input.Query @@ -22697,7 +22903,7 @@ public enum Operations { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -23599,7 +23805,7 @@ public enum Operations { /// To use this endpoint, the authenticated user must be one of: /// /// - An administrator for the organization. - /// - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization. + /// - An organization member (or a member of a team) assigned a custom organization role that includes the **View organization roles** (`read_organization_custom_org_role`) permission. For more information, see "[Permissions for organization access](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/permissions-of-custom-organization-roles#permissions-for-organization-access)." /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// From d8cb7ac8736588a7ae4c0bfd0a7096d8a2f4f5cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:55:39 +0000 Subject: [PATCH 12/27] Commit via running: make Sources/packages --- Sources/packages/Types.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index 4fb3d95047..ff53668917 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -1681,8 +1681,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.NullableMinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/nullable-minimal-repository/disabled`. @@ -1901,7 +1899,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -1993,7 +1990,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.NullableMinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -2085,7 +2081,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2178,7 +2173,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 9e4843b9a2c764e1c3f48bbc935277a92ae3a765 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:56:01 +0000 Subject: [PATCH 13/27] Commit via running: make Sources/pulls --- Sources/pulls/Types.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Sources/pulls/Types.swift b/Sources/pulls/Types.swift index 939bb274c2..0b31e9f3e5 100644 --- a/Sources/pulls/Types.swift +++ b/Sources/pulls/Types.swift @@ -1821,10 +1821,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -2072,7 +2068,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -2172,7 +2167,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2272,7 +2266,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2373,7 +2366,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 54de22c7008757f45bb13d41e34d12bf7670922a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:57:08 +0000 Subject: [PATCH 14/27] Commit via running: make Sources/repos --- Sources/repos/Client.swift | 81 +++++++++++++ Sources/repos/Types.swift | 226 +++++++++++++++++++++++++++++++------ 2 files changed, 272 insertions(+), 35 deletions(-) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index 8293691e91..315b3899c4 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -11826,6 +11826,13 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "status", + value: input.query.status + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -15638,12 +15645,38 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -15807,6 +15840,28 @@ public struct Client: APIProtocol { 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, @@ -16101,12 +16156,38 @@ public struct Client: APIProtocol { method: .delete ) suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 204: return .noContent(.init()) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index bd393eb601..b924b94a94 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -5115,8 +5115,14 @@ extension APIProtocol { /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/assets/{asset_id}/delete(repos/delete-release-asset)`. - public func reposDeleteReleaseAsset(path: Operations.ReposDeleteReleaseAsset.Input.Path) async throws -> Operations.ReposDeleteReleaseAsset.Output { - try await reposDeleteReleaseAsset(Operations.ReposDeleteReleaseAsset.Input(path: path)) + public func reposDeleteReleaseAsset( + path: Operations.ReposDeleteReleaseAsset.Input.Path, + headers: Operations.ReposDeleteReleaseAsset.Input.Headers = .init() + ) async throws -> Operations.ReposDeleteReleaseAsset.Output { + try await reposDeleteReleaseAsset(Operations.ReposDeleteReleaseAsset.Input( + path: path, + headers: headers + )) } /// Generate release notes content for a release /// @@ -5208,8 +5214,14 @@ extension APIProtocol { /// /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/releases/{release_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/delete(repos/delete-release)`. - public func reposDeleteRelease(path: Operations.ReposDeleteRelease.Input.Path) async throws -> Operations.ReposDeleteRelease.Output { - try await reposDeleteRelease(Operations.ReposDeleteRelease.Input(path: path)) + public func reposDeleteRelease( + path: Operations.ReposDeleteRelease.Input.Path, + headers: Operations.ReposDeleteRelease.Input.Headers = .init() + ) async throws -> Operations.ReposDeleteRelease.Output { + try await reposDeleteRelease(Operations.ReposDeleteRelease.Input( + path: path, + headers: headers + )) } /// List release assets /// @@ -7493,10 +7505,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -7744,7 +7752,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -7844,7 +7851,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -7944,7 +7950,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -8045,7 +8050,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -9329,8 +9333,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -9549,7 +9551,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -9641,7 +9642,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -9733,7 +9733,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -9826,7 +9825,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -10951,10 +10949,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. @@ -11202,7 +11196,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -11302,7 +11295,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -11402,7 +11394,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -11503,7 +11494,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -11722,8 +11712,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/full-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -12003,7 +11991,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -12110,7 +12097,6 @@ public enum Components { hasDiscussions: Swift.Bool, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -12217,7 +12203,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -12325,7 +12310,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -23369,6 +23353,13 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/cursor`. public typealias Cursor = Swift.String + /// Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). + /// + /// - Remark: Generated from `#/components/parameters/webhook-delivery-status`. + @frozen public enum WebhookDeliveryStatus: String, Codable, Hashable, Sendable, CaseIterable { + case success = "success" + case failure = "failure" + } /// - Remark: Generated from `#/components/parameters/delivery-id`. public typealias DeliveryId = 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)." @@ -49219,17 +49210,29 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.Cursor? + /// - Remark: Generated from `#/components/parameters/webhook-delivery-status`. + @frozen public enum WebhookDeliveryStatus: String, Codable, Hashable, Sendable, CaseIterable { + case success = "success" + case failure = "failure" + } + /// Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/GET/query/status`. + public var status: Components.Parameters.WebhookDeliveryStatus? /// 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)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + /// - status: Returns webhook deliveries filtered by delivery outcome classification based on `status_code` range. A `status` of `success` returns deliveries with a `status_code` in the 200-399 range (inclusive). A `status` of `failure` returns deliveries with a `status_code` in the 400-599 range (inclusive). public init( perPage: Components.Parameters.PerPage? = nil, - cursor: Components.Parameters.Cursor? = nil + cursor: Components.Parameters.Cursor? = nil, + status: Components.Parameters.WebhookDeliveryStatus? = nil ) { self.perPage = perPage self.cursor = cursor + self.status = status } } public var query: Operations.ReposListWebhookDeliveries.Input.Query @@ -57280,12 +57283,29 @@ public enum Operations { } } public var path: Operations.ReposDeleteReleaseAsset.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/assets/{asset_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.ReposDeleteReleaseAsset.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ReposDeleteReleaseAsset.Input.Path) { + /// - headers: + public init( + path: Operations.ReposDeleteReleaseAsset.Input.Path, + headers: Operations.ReposDeleteReleaseAsset.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -57324,11 +57344,59 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/assets/{asset_id}/delete(repos/delete-release-asset)/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 + ] + } + } } /// Generate release notes content for a release /// @@ -57658,6 +57726,29 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/latest/get(repos/get-latest-release)/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. @@ -58377,12 +58468,29 @@ public enum Operations { } } public var path: Operations.ReposDeleteRelease.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/releases/{release_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.ReposDeleteRelease.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - public init(path: Operations.ReposDeleteRelease.Input.Path) { + /// - headers: + public init( + path: Operations.ReposDeleteRelease.Input.Path, + headers: Operations.ReposDeleteRelease.Input.Headers = .init() + ) { self.path = path + self.headers = headers } } @frozen public enum Output: Sendable, Hashable { @@ -58421,11 +58529,59 @@ public enum Operations { } } } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/releases/{release_id}/delete(repos/delete-release)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } } /// List release assets /// From 73cd2b6c687cee9d68537e8ad06f1bb04bcc690f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:57:31 +0000 Subject: [PATCH 15/27] Commit via running: make Sources/search --- Sources/search/Client.swift | 32 ++++++++ Sources/search/Types.swift | 153 ++++++++++++++++++++++++++++++------ 2 files changed, 163 insertions(+), 22 deletions(-) diff --git a/Sources/search/Client.swift b/Sources/search/Client.swift index fe57d347b6..83e5fc2684 100644 --- a/Sources/search/Client.swift +++ b/Sources/search/Client.swift @@ -59,6 +59,9 @@ public struct Client: APIProtocol { /// * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing /// language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. /// + /// > [!NOTE] + /// > `repository.description`, `repository.owner.type`, and `repository.owner.node_id` are closing down on this endpoint and will return `null` in a future API version. Use the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint (`GET /repos/{owner}/{repo}`) to retrieve full repository metadata. + /// /// This endpoint requires you to authenticate and limits you to 10 requests per minute. /// /// - Remark: HTTP `GET /search/code`. @@ -402,6 +405,13 @@ public struct Client: APIProtocol { name: "advanced_search", value: input.query.advancedSearch ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "search_type", + value: input.query.searchType + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -500,6 +510,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .forbidden(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/search/Types.swift b/Sources/search/Types.swift index 0b8c3f8a2a..131bb56d69 100644 --- a/Sources/search/Types.swift +++ b/Sources/search/Types.swift @@ -32,6 +32,9 @@ public protocol APIProtocol: Sendable { /// * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing /// language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. /// + /// > [!NOTE] + /// > `repository.description`, `repository.owner.type`, and `repository.owner.node_id` are closing down on this endpoint and will return `null` in a future API version. Use the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint (`GET /repos/{owner}/{repo}`) to retrieve full repository metadata. + /// /// This endpoint requires you to authenticate and limits you to 10 requests per minute. /// /// - Remark: HTTP `GET /search/code`. @@ -157,6 +160,9 @@ extension APIProtocol { /// * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing /// language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. /// + /// > [!NOTE] + /// > `repository.description`, `repository.owner.type`, and `repository.owner.node_id` are closing down on this endpoint and will return `null` in a future API version. Use the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint (`GET /repos/{owner}/{repo}`) to retrieve full repository metadata. + /// /// This endpoint requires you to authenticate and limits you to 10 requests per minute. /// /// - Remark: HTTP `GET /search/code`. @@ -1145,10 +1151,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1396,7 +1398,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -1496,7 +1497,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -1596,7 +1596,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -1697,7 +1696,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -3144,8 +3142,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -3364,7 +3360,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -3456,7 +3451,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3548,7 +3542,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3641,7 +3634,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4698,8 +4690,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repo-search-result-item/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.RepoSearchResultItem.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/repo-search-result-item/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/repo-search-result-item/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -4854,7 +4844,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -4947,7 +4936,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.RepoSearchResultItem.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -5040,7 +5028,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -5134,7 +5121,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -5611,6 +5597,19 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/issues-advanced-search`. public typealias IssuesAdvancedSearch = Swift.String + /// The type of search to perform on issues. When not specified, the default is lexical search. + /// + /// - `semantic` — performs a pure semantic (vector) search using embedding-based understanding. + /// - `hybrid` — combines semantic search with lexical search for best results. + /// + /// Semantic and hybrid search require authentication and are rate limited to 10 requests per minute. + /// Only applies to issue searches (`/search/issues`). + /// + /// - Remark: Generated from `#/components/parameters/search-type`. + @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { + case semantic = "semantic" + case hybrid = "hybrid" + } } /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. public enum RequestBodies {} @@ -5676,6 +5675,34 @@ public enum Components { /// Creates a new `NotModified`. public init() {} } + public struct RequiresAuthentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.RequiresAuthentication.Body + /// Creates a new `RequiresAuthentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.RequiresAuthentication.Body) { + self.body = body + } + } public struct Forbidden: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/forbidden/content`. @frozen public enum Body: Sendable, Hashable { @@ -5789,6 +5816,9 @@ public enum Operations { /// * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing /// language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. /// + /// > [!NOTE] + /// > `repository.description`, `repository.owner.type`, and `repository.owner.node_id` are closing down on this endpoint and will return `null` in a future API version. Use the [Get a repository](https://docs.github.com/rest/repos/repos#get-a-repository) endpoint (`GET /repos/{owner}/{repo}`) to retrieve full repository metadata. + /// /// This endpoint requires you to authenticate and limits you to 10 requests per minute. /// /// - Remark: HTTP `GET /search/code`. @@ -6395,6 +6425,21 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/search/issues/GET/query/advanced_search`. public var advancedSearch: Components.Parameters.IssuesAdvancedSearch? + /// - Remark: Generated from `#/components/parameters/search-type`. + @frozen public enum SearchType: String, Codable, Hashable, Sendable, CaseIterable { + case semantic = "semantic" + case hybrid = "hybrid" + } + /// The type of search to perform on issues. When not specified, the default is lexical search. + /// + /// - `semantic` — performs a pure semantic (vector) search using embedding-based understanding. + /// - `hybrid` — combines semantic search with lexical search for best results. + /// + /// Semantic and hybrid search require authentication and are rate limited to 10 requests per minute. + /// Only applies to issue searches (`/search/issues`). + /// + /// - Remark: Generated from `#/paths/search/issues/GET/query/search_type`. + public var searchType: Components.Parameters.SearchType? /// Creates a new `Query`. /// /// - Parameters: @@ -6404,13 +6449,15 @@ public enum Operations { /// - perPage: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - advancedSearch: Set to `true` to use advanced search. + /// - searchType: The type of search to perform on issues. When not specified, the default is lexical search. public init( q: Swift.String, sort: Operations.SearchIssuesAndPullRequests.Input.Query.SortPayload? = nil, order: Components.Parameters.Order? = nil, perPage: Components.Parameters.PerPage? = nil, page: Components.Parameters.Page? = nil, - advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil + advancedSearch: Components.Parameters.IssuesAdvancedSearch? = nil, + searchType: Components.Parameters.SearchType? = nil ) { self.q = q self.sort = sort @@ -6418,6 +6465,7 @@ public enum Operations { self.perPage = perPage self.page = page self.advancedSearch = advancedSearch + self.searchType = searchType } } public var query: Operations.SearchIssuesAndPullRequests.Input.Query @@ -6458,25 +6506,63 @@ public enum Operations { public var incompleteResults: Swift.Bool /// - Remark: Generated from `#/paths/search/issues/GET/responses/200/content/json/items`. public var items: [Components.Schemas.IssueSearchResultItem] + /// The type of search that was performed. Possible values are `lexical`, `semantic`, or `hybrid`. + /// + /// - Remark: Generated from `#/paths/search/issues/GET/responses/200/content/json/search_type`. + @frozen public enum SearchTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case lexical = "lexical" + case semantic = "semantic" + case hybrid = "hybrid" + } + /// The type of search that was performed. Possible values are `lexical`, `semantic`, or `hybrid`. + /// + /// - Remark: Generated from `#/paths/search/issues/GET/responses/200/content/json/search_type`. + public var searchType: Operations.SearchIssuesAndPullRequests.Output.Ok.Body.JsonPayload.SearchTypePayload + /// - Remark: Generated from `#/paths/search/issues/GET/responses/200/content/json/LexicalFallbackReasonPayload`. + @frozen public enum LexicalFallbackReasonPayloadPayload: String, Codable, Hashable, Sendable, CaseIterable { + case noTextTerms = "no_text_terms" + case quotedText = "quoted_text" + case nonIssueTarget = "non_issue_target" + case orBooleanNotSupported = "or_boolean_not_supported" + case noAccessibleRepos = "no_accessible_repos" + case serverError = "server_error" + case onlyNonSemanticFieldsRequested = "only_non_semantic_fields_requested" + } + /// When a semantic or hybrid search falls back to lexical search, this field contains the reasons for the fallback. Only present when a fallback occurred. + /// + /// - Remark: Generated from `#/paths/search/issues/GET/responses/200/content/json/lexical_fallback_reason`. + public typealias LexicalFallbackReasonPayload = [Operations.SearchIssuesAndPullRequests.Output.Ok.Body.JsonPayload.LexicalFallbackReasonPayloadPayload] + /// When a semantic or hybrid search falls back to lexical search, this field contains the reasons for the fallback. Only present when a fallback occurred. + /// + /// - Remark: Generated from `#/paths/search/issues/GET/responses/200/content/json/lexical_fallback_reason`. + public var lexicalFallbackReason: Operations.SearchIssuesAndPullRequests.Output.Ok.Body.JsonPayload.LexicalFallbackReasonPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - totalCount: /// - incompleteResults: /// - items: + /// - searchType: The type of search that was performed. Possible values are `lexical`, `semantic`, or `hybrid`. + /// - lexicalFallbackReason: When a semantic or hybrid search falls back to lexical search, this field contains the reasons for the fallback. Only present when a fallback occurred. public init( totalCount: Swift.Int, incompleteResults: Swift.Bool, - items: [Components.Schemas.IssueSearchResultItem] + items: [Components.Schemas.IssueSearchResultItem], + searchType: Operations.SearchIssuesAndPullRequests.Output.Ok.Body.JsonPayload.SearchTypePayload, + lexicalFallbackReason: Operations.SearchIssuesAndPullRequests.Output.Ok.Body.JsonPayload.LexicalFallbackReasonPayload? = nil ) { self.totalCount = totalCount self.incompleteResults = incompleteResults self.items = items + self.searchType = searchType + self.lexicalFallbackReason = lexicalFallbackReason } public enum CodingKeys: String, CodingKey { case totalCount = "total_count" case incompleteResults = "incomplete_results" case items + case searchType = "search_type" + case lexicalFallbackReason = "lexical_fallback_reason" } } /// - Remark: Generated from `#/paths/search/issues/GET/responses/200/content/application\/json`. @@ -6627,6 +6713,29 @@ public enum Operations { } } } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//search/issues/get(search/issues-and-pull-requests)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. From 1da21a8fc1c5bdde7e90b43ce4b53a32f530c3f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:57:53 +0000 Subject: [PATCH 16/27] Commit via running: make Sources/secret-scanning --- Sources/secret-scanning/Types.swift | 175 +++++++++++++++++++++++++--- 1 file changed, 162 insertions(+), 13 deletions(-) diff --git a/Sources/secret-scanning/Types.swift b/Sources/secret-scanning/Types.swift index e370e69ad7..6515ebb38c 100644 --- a/Sources/secret-scanning/Types.swift +++ b/Sources/secret-scanning/Types.swift @@ -1278,6 +1278,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/commit_url`. public var commitUrl: Swift.String + /// The GitHub URL to get the associated commit resource. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-commit/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationCommit`. /// /// - Parameters: @@ -1290,6 +1294,7 @@ public enum Components { /// - blobUrl: The API URL to get the associated blob resource /// - commitSha: SHA-1 hash ID of the associated commit /// - commitUrl: The API URL to get the associated commit resource + /// - htmlUrl: The GitHub URL to get the associated commit resource. public init( path: Swift.String, startLine: Swift.Double, @@ -1299,7 +1304,8 @@ public enum Components { blobSha: Swift.String, blobUrl: Swift.String, commitSha: Swift.String, - commitUrl: Swift.String + commitUrl: Swift.String, + htmlUrl: Swift.String? = nil ) { self.path = path self.startLine = startLine @@ -1310,6 +1316,7 @@ public enum Components { self.blobUrl = blobUrl self.commitSha = commitSha self.commitUrl = commitUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case path @@ -1321,6 +1328,7 @@ public enum Components { case blobUrl = "blob_url" case commitSha = "commit_sha" case commitUrl = "commit_url" + case htmlUrl = "html_url" } } /// Represents a 'wiki_commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki. @@ -1416,15 +1424,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-title/issue_title_url`. public var issueTitleUrl: Swift.String + /// The GitHub URL for the issue where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-title/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationIssueTitle`. /// /// - Parameters: /// - issueTitleUrl: The API URL to get the issue where the secret was detected. - public init(issueTitleUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the issue where the secret was detected. + public init( + issueTitleUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.issueTitleUrl = issueTitleUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case issueTitleUrl = "issue_title_url" + case htmlUrl = "html_url" } } /// Represents an 'issue_body' secret scanning location type. This location type shows that a secret was detected in the body of an issue. @@ -1435,15 +1453,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-body/issue_body_url`. public var issueBodyUrl: Swift.String + /// The GitHub URL for the issue where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-body/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationIssueBody`. /// /// - Parameters: /// - issueBodyUrl: The API URL to get the issue where the secret was detected. - public init(issueBodyUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the issue where the secret was detected. + public init( + issueBodyUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.issueBodyUrl = issueBodyUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case issueBodyUrl = "issue_body_url" + case htmlUrl = "html_url" } } /// Represents an 'issue_comment' secret scanning location type. This location type shows that a secret was detected in a comment on an issue. @@ -1454,15 +1482,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-comment/issue_comment_url`. public var issueCommentUrl: Swift.String + /// The GitHub URL for the issue comment where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-issue-comment/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationIssueComment`. /// /// - Parameters: /// - issueCommentUrl: The API URL to get the issue comment where the secret was detected. - public init(issueCommentUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the issue comment where the secret was detected. + public init( + issueCommentUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.issueCommentUrl = issueCommentUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case issueCommentUrl = "issue_comment_url" + case htmlUrl = "html_url" } } /// Represents a 'discussion_title' secret scanning location type. This location type shows that a secret was detected in the title of a discussion. @@ -1530,15 +1568,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-title/pull_request_title_url`. public var pullRequestTitleUrl: Swift.String + /// The GitHub URL for the pull request where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-title/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationPullRequestTitle`. /// /// - Parameters: /// - pullRequestTitleUrl: The API URL to get the pull request where the secret was detected. - public init(pullRequestTitleUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the pull request where the secret was detected. + public init( + pullRequestTitleUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.pullRequestTitleUrl = pullRequestTitleUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case pullRequestTitleUrl = "pull_request_title_url" + case htmlUrl = "html_url" } } /// Represents a 'pull_request_body' secret scanning location type. This location type shows that a secret was detected in the body of a pull request. @@ -1549,15 +1597,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-body/pull_request_body_url`. public var pullRequestBodyUrl: Swift.String + /// The GitHub URL for the pull request where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-body/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationPullRequestBody`. /// /// - Parameters: /// - pullRequestBodyUrl: The API URL to get the pull request where the secret was detected. - public init(pullRequestBodyUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the pull request where the secret was detected. + public init( + pullRequestBodyUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.pullRequestBodyUrl = pullRequestBodyUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case pullRequestBodyUrl = "pull_request_body_url" + case htmlUrl = "html_url" } } /// Represents a 'pull_request_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a pull request. @@ -1568,15 +1626,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-comment/pull_request_comment_url`. public var pullRequestCommentUrl: Swift.String + /// The GitHub URL for the pull request comment where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-comment/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationPullRequestComment`. /// /// - Parameters: /// - pullRequestCommentUrl: The API URL to get the pull request comment where the secret was detected. - public init(pullRequestCommentUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the pull request comment where the secret was detected. + public init( + pullRequestCommentUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.pullRequestCommentUrl = pullRequestCommentUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case pullRequestCommentUrl = "pull_request_comment_url" + case htmlUrl = "html_url" } } /// Represents a 'pull_request_review' secret scanning location type. This location type shows that a secret was detected in a review on a pull request. @@ -1587,15 +1655,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review/pull_request_review_url`. public var pullRequestReviewUrl: Swift.String + /// The GitHub URL for the pull request review where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationPullRequestReview`. /// /// - Parameters: /// - pullRequestReviewUrl: The API URL to get the pull request review where the secret was detected. - public init(pullRequestReviewUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the pull request review where the secret was detected. + public init( + pullRequestReviewUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.pullRequestReviewUrl = pullRequestReviewUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case pullRequestReviewUrl = "pull_request_review_url" + case htmlUrl = "html_url" } } /// Represents a 'pull_request_review_comment' secret scanning location type. This location type shows that a secret was detected in a review comment on a pull request. @@ -1606,15 +1684,25 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review-comment/pull_request_review_comment_url`. public var pullRequestReviewCommentUrl: Swift.String + /// The GitHub URL for the pull request review comment where the secret was detected. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-location-pull-request-review-comment/html_url`. + public var htmlUrl: Swift.String? /// Creates a new `SecretScanningLocationPullRequestReviewComment`. /// /// - Parameters: /// - pullRequestReviewCommentUrl: The API URL to get the pull request review comment where the secret was detected. - public init(pullRequestReviewCommentUrl: Swift.String) { + /// - htmlUrl: The GitHub URL for the pull request review comment where the secret was detected. + public init( + pullRequestReviewCommentUrl: Swift.String, + htmlUrl: Swift.String? = nil + ) { self.pullRequestReviewCommentUrl = pullRequestReviewCommentUrl + self.htmlUrl = htmlUrl } public enum CodingKeys: String, CodingKey { case pullRequestReviewCommentUrl = "pull_request_review_comment_url" + case htmlUrl = "html_url" } } /// Details on the location where the token was initially detected. This can be a commit, wiki commit, issue, discussion, pull request. @@ -1866,6 +1954,16 @@ public enum Components { public var hasMoreLocations: Swift.Bool? /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/assigned_to`. public var assignedTo: Components.Schemas.NullableSimpleUser? + /// An optional comment from the closure request author. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/closure_request_comment`. + public var closureRequestComment: Swift.String? + /// An optional comment from the closure request reviewer. + /// + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/closure_request_reviewer_comment`. + public var closureRequestReviewerComment: Swift.String? + /// - Remark: Generated from `#/components/schemas/organization-secret-scanning-alert/closure_request_reviewer`. + public var closureRequestReviewer: Components.Schemas.NullableSimpleUser? /// Creates a new `OrganizationSecretScanningAlert`. /// /// - Parameters: @@ -1898,6 +1996,9 @@ public enum Components { /// - 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: public init( number: Components.Schemas.AlertNumber? = nil, createdAt: Components.Schemas.AlertCreatedAt? = nil, @@ -1927,7 +2028,10 @@ public enum Components { isBase64Encoded: Swift.Bool? = nil, firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? = nil, hasMoreLocations: Swift.Bool? = nil, - assignedTo: Components.Schemas.NullableSimpleUser? = nil + assignedTo: Components.Schemas.NullableSimpleUser? = nil, + closureRequestComment: Swift.String? = nil, + closureRequestReviewerComment: Swift.String? = nil, + closureRequestReviewer: Components.Schemas.NullableSimpleUser? = nil ) { self.number = number self.createdAt = createdAt @@ -1958,6 +2062,9 @@ public enum Components { self.firstLocationDetected = firstLocationDetected self.hasMoreLocations = hasMoreLocations self.assignedTo = assignedTo + self.closureRequestComment = closureRequestComment + self.closureRequestReviewerComment = closureRequestReviewerComment + self.closureRequestReviewer = closureRequestReviewer } public enum CodingKeys: String, CodingKey { case number @@ -1989,6 +2096,9 @@ public enum Components { 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" } } /// The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update. @@ -2263,6 +2373,16 @@ public enum Components { public var hasMoreLocations: Swift.Bool? /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/assigned_to`. public var assignedTo: Components.Schemas.NullableSimpleUser? + /// An optional comment from the closure request author. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/closure_request_comment`. + public var closureRequestComment: Swift.String? + /// An optional comment from the closure request reviewer. + /// + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/closure_request_reviewer_comment`. + public var closureRequestReviewerComment: Swift.String? + /// - Remark: Generated from `#/components/schemas/secret-scanning-alert/closure_request_reviewer`. + public var closureRequestReviewer: Components.Schemas.NullableSimpleUser? /// Creates a new `SecretScanningAlert`. /// /// - Parameters: @@ -2294,6 +2414,9 @@ public enum Components { /// - 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: public init( number: Components.Schemas.AlertNumber? = nil, createdAt: Components.Schemas.AlertCreatedAt? = nil, @@ -2322,7 +2445,10 @@ public enum Components { isBase64Encoded: Swift.Bool? = nil, firstLocationDetected: Components.Schemas.NullableSecretScanningFirstDetectedLocation? = nil, hasMoreLocations: Swift.Bool? = nil, - assignedTo: Components.Schemas.NullableSimpleUser? = nil + assignedTo: Components.Schemas.NullableSimpleUser? = nil, + closureRequestComment: Swift.String? = nil, + closureRequestReviewerComment: Swift.String? = nil, + closureRequestReviewer: Components.Schemas.NullableSimpleUser? = nil ) { self.number = number self.createdAt = createdAt @@ -2352,6 +2478,9 @@ public enum Components { self.firstLocationDetected = firstLocationDetected self.hasMoreLocations = hasMoreLocations self.assignedTo = assignedTo + self.closureRequestComment = closureRequestComment + self.closureRequestReviewerComment = closureRequestReviewerComment + self.closureRequestReviewer = closureRequestReviewer } public enum CodingKeys: String, CodingKey { case number @@ -2382,6 +2511,9 @@ public enum Components { 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" } } /// - Remark: Generated from `#/components/schemas/secret-scanning-location`. @@ -4641,17 +4773,27 @@ public enum Operations { } /// - 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 + 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] = [] @@ -4665,10 +4807,16 @@ public enum Operations { } catch { errors.append(error) } + do { + self.value3 = try .init(from: decoder) + } catch { + errors.append(error) + } try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( [ self.value1, - self.value2 + self.value2, + self.value3 ], type: Self.self, codingPath: decoder.codingPath, @@ -4678,6 +4826,7 @@ public enum Operations { 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`. From ba299f7fa4695eaf850053a69c4f5739782b0235 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:58:15 +0000 Subject: [PATCH 17/27] Commit via running: make Sources/teams --- Sources/teams/Types.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Sources/teams/Types.swift b/Sources/teams/Types.swift index 2113a42d7e..9f676e6587 100644 --- a/Sources/teams/Types.swift +++ b/Sources/teams/Types.swift @@ -2113,8 +2113,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -2333,7 +2331,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -2425,7 +2422,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -2517,7 +2513,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2610,7 +2605,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 668649b0acf20e0b9c428bf9b5286c66794cefab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:59:00 +0000 Subject: [PATCH 18/27] Commit via running: make Sources/codespaces --- Sources/codespaces/Types.swift | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Sources/codespaces/Types.swift b/Sources/codespaces/Types.swift index bae685b3d4..fa7a62cc8d 100644 --- a/Sources/codespaces/Types.swift +++ b/Sources/codespaces/Types.swift @@ -2181,10 +2181,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -2432,7 +2428,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -2532,7 +2527,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2632,7 +2626,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2733,7 +2726,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -3282,8 +3274,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -3502,7 +3492,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -3594,7 +3583,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -3686,7 +3674,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -3779,7 +3766,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4579,10 +4565,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. @@ -4830,7 +4812,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -4930,7 +4911,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -5030,7 +5010,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -5131,7 +5110,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -5350,8 +5328,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/full-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -5631,7 +5607,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -5738,7 +5713,6 @@ public enum Components { hasDiscussions: Swift.Bool, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -5845,7 +5819,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -5953,7 +5926,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 974f97c8d20e7e017839451ca5449e8cffee90e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:59:22 +0000 Subject: [PATCH 19/27] Commit via running: make Sources/copilot --- Sources/copilot/Client.swift | 2342 +++++++++++---- Sources/copilot/Types.swift | 5324 ++++++++++++++++++++++++---------- 2 files changed, 5480 insertions(+), 2186 deletions(-) diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index a70d8b1129..5cb15a72c7 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -38,30 +38,27 @@ public struct Client: APIProtocol { private var converter: Converter { client.converter } - /// Get Copilot seat information and settings for an organization + /// Get Copilot enterprise usage metrics for a specific day /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Use this endpoint to retrieve download links for the Copilot enterprise usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the enterprise. /// - /// Gets information about an organization's Copilot subscription, including seat breakdown - /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time. /// - /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. + /// 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// 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 /orgs/{org}/copilot/billing`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. - public func copilotGetCopilotOrganizationDetails(_ input: Operations.CopilotGetCopilotOrganizationDetails.Input) async throws -> Operations.CopilotGetCopilotOrganizationDetails.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)`. + public func copilotCopilotEnterpriseOneDayUsageMetrics(_ input: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Output { try await client.send( input: input, - forOperation: Operations.CopilotGetCopilotOrganizationDetails.id, + forOperation: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing", + template: "/enterprises/{}/copilot/metrics/reports/enterprise-1-day", parameters: [ - input.path.org + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -69,6 +66,13 @@ public struct Client: APIProtocol { 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 @@ -79,7 +83,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body + let body: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -89,7 +93,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.CopilotOrganizationDetails.self, + Components.Schemas.CopilotUsageMetrics1DayReport.self, from: responseBody, transforming: { value in .json(value) @@ -121,28 +125,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -187,8 +169,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -201,30 +181,27 @@ public struct Client: APIProtocol { } ) } - /// List all Copilot seat assignments for an organization + /// Get Copilot enterprise usage metrics /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Use this endpoint to retrieve download links for the latest 28-day enterprise Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the enterprise. /// - /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. - /// Only organization owners can view assigned seats. + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time. /// - /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). + /// The response includes download links to the report files, along with the specific date range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// 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 /orgs/{org}/copilot/billing/seats`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. - public func copilotListCopilotSeats(_ input: Operations.CopilotListCopilotSeats.Input) async throws -> Operations.CopilotListCopilotSeats.Output { + /// - 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)`. + public func copilotCopilotEnterpriseUsageMetrics(_ input: Operations.CopilotCopilotEnterpriseUsageMetrics.Input) async throws -> Operations.CopilotCopilotEnterpriseUsageMetrics.Output { try await client.send( input: input, - forOperation: Operations.CopilotListCopilotSeats.id, + forOperation: Operations.CopilotCopilotEnterpriseUsageMetrics.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/seats", + template: "/enterprises/{}/copilot/metrics/reports/enterprise-28-day/latest", parameters: [ - input.path.org + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -232,20 +209,6 @@ public struct Client: APIProtocol { 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 @@ -255,13 +218,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.CopilotListCopilotSeats.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.CopilotListCopilotSeats.Output.Ok.Body + let body: Operations.CopilotCopilotEnterpriseUsageMetrics.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -271,7 +229,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotListCopilotSeats.Output.Ok.Body.JsonPayload.self, + Components.Schemas.CopilotUsageMetrics28DayReport.self, from: responseBody, transforming: { value in .json(value) @@ -280,10 +238,7 @@ 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 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -306,28 +261,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -384,60 +317,52 @@ public struct Client: APIProtocol { } ) } - /// Add teams to the Copilot subscription for an organization + /// Get Copilot users usage metrics for a specific day /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. - /// - /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// Use this endpoint to retrieve download links for the Copilot user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. /// - /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." - /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. /// - /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// 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 `POST /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. - public func copilotAddCopilotSeatsForTeams(_ input: Operations.CopilotAddCopilotSeatsForTeams.Input) async throws -> Operations.CopilotAddCopilotSeatsForTeams.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)`. + public func copilotCopilotUsersOneDayUsageMetrics(_ input: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotUsersOneDayUsageMetrics.Output { try await client.send( input: input, - forOperation: Operations.CopilotAddCopilotSeatsForTeams.id, + forOperation: Operations.CopilotCopilotUsersOneDayUsageMetrics.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_teams", + template: "/enterprises/{}/copilot/metrics/reports/users-1-day", parameters: [ - input.path.org + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + 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 ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body + let body: Operations.CopilotCopilotUsersOneDayUsageMetrics.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -447,7 +372,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload.self, + Components.Schemas.CopilotUsageMetrics1DayReport.self, from: responseBody, transforming: { value in .json(value) @@ -456,7 +381,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -479,28 +404,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -545,8 +448,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -559,59 +460,45 @@ public struct Client: APIProtocol { } ) } - /// Remove teams from the Copilot subscription for an organization - /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Get Copilot users usage metrics /// - /// Sets seats for all members of each team specified to "pending cancellation". - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. - /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// Use this endpoint to retrieve download links for the latest 28-day enterprise users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. /// - /// The response contains the total number of seats set to "pending cancellation". + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// 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 `DELETE /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. - public func copilotCancelCopilotSeatAssignmentForTeams(_ input: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input) async throws -> Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)`. + public func copilotCopilotUsersUsageMetrics(_ input: Operations.CopilotCopilotUsersUsageMetrics.Input) async throws -> Operations.CopilotCopilotUsersUsageMetrics.Output { try await client.send( input: input, - forOperation: Operations.CopilotCancelCopilotSeatAssignmentForTeams.id, + forOperation: Operations.CopilotCopilotUsersUsageMetrics.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_teams", + template: "/enterprises/{}/copilot/metrics/reports/users-28-day/latest", parameters: [ - input.path.org + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body + let body: Operations.CopilotCopilotUsersUsageMetrics.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -621,7 +508,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body.JsonPayload.self, + Components.Schemas.CopilotUsageMetrics28DayReport.self, from: responseBody, transforming: { value in .json(value) @@ -653,28 +540,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -719,8 +584,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -733,60 +596,48 @@ public struct Client: APIProtocol { } ) } - /// Add users to the Copilot subscription for an organization + /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." - /// - /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." - /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// Gets information about an organization's Copilot subscription, including seat breakdown + /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// - /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. - public func copilotAddCopilotSeatsForUsers(_ input: Operations.CopilotAddCopilotSeatsForUsers.Input) async throws -> Operations.CopilotAddCopilotSeatsForUsers.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. + public func copilotGetCopilotOrganizationDetails(_ input: Operations.CopilotGetCopilotOrganizationDetails.Input) async throws -> Operations.CopilotGetCopilotOrganizationDetails.Output { try await client.send( input: input, - forOperation: Operations.CopilotAddCopilotSeatsForUsers.id, + forOperation: Operations.CopilotGetCopilotOrganizationDetails.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_users", + template: "/orgs/{}/copilot/billing", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body + let body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -796,7 +647,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload.self, + Components.Schemas.CopilotOrganizationDetails.self, from: responseBody, transforming: { value in .json(value) @@ -805,7 +656,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -908,59 +759,67 @@ public struct Client: APIProtocol { } ) } - /// Remove users from the Copilot subscription for an organization + /// List all Copilot seat assignments for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Sets seats for all users specified to "pending cancellation". - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. - /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." - /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. + /// Only organization owners can view assigned seats. /// - /// The response contains the total number of seats set to "pending cancellation". + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. - public func copilotCancelCopilotSeatAssignmentForUsers(_ input: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input) async throws -> Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. + public func copilotListCopilotSeats(_ input: Operations.CopilotListCopilotSeats.Input) async throws -> Operations.CopilotListCopilotSeats.Output { try await client.send( input: input, - forOperation: Operations.CopilotCancelCopilotSeatAssignmentForUsers.id, + forOperation: Operations.CopilotListCopilotSeats.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_users", + template: "/orgs/{}/copilot/billing/seats", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + 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 ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.CopilotListCopilotSeats.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.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body + let body: Operations.CopilotListCopilotSeats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -970,7 +829,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body.JsonPayload.self, + Operations.CopilotListCopilotSeats.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -979,7 +838,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 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -1068,8 +930,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1082,48 +942,60 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot coding agent permissions for an organization + /// Add teams to the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Gets information about which repositories in an organization have been enabled - /// or disabled for the Copilot coding agent. + /// Purchases a GitHub Copilot seat for all users within each specified team. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// Organization owners can configure whether Copilot coding agent is enabled for - /// all repositories, selected repositories, or no repositories owned by organization. + /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// The response contains the total number of new seats that were created and existing seats that were refreshed. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. - public func copilotGetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. + public func copilotAddCopilotSeatsForTeams(_ input: Operations.CopilotAddCopilotSeatsForTeams.Input) async throws -> Operations.CopilotAddCopilotSeatsForTeams.Output { try await client.send( input: input, - forOperation: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.id, + forOperation: Operations.CopilotAddCopilotSeatsForTeams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/coding-agent/permissions", + template: "/orgs/{}/copilot/billing/selected_teams", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) 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.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body + let body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1133,7 +1005,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.self, + Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1142,7 +1014,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -1231,6 +1103,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1243,34 +1117,37 @@ public struct Client: APIProtocol { } ) } - /// Set Copilot coding agent permissions for an organization + /// Remove teams from the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Sets the policy for which repositories in an organization can use Copilot coding agent. + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. + /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// - /// Organization owners can configure whether Copilot coding agent is enabled for - /// all repositories, selected repositories, or no repositories owned by the organization. + /// Only organization owners can cancel Copilot seats for their organization members. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// The response contains the total number of seats set to "pending cancellation". /// - /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. - public func copilotSetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. + public func copilotCancelCopilotSeatAssignmentForTeams(_ input: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input) async throws -> Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output { try await client.send( input: input, - forOperation: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.id, + forOperation: Operations.CopilotCancelCopilotSeatAssignmentForTeams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/coding-agent/permissions", + template: "/orgs/{}/copilot/billing/selected_teams", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -1290,11 +1167,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 500: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body + let body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1304,7 +1179,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1313,10 +1188,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .internalServerError(.init(body: body)) - case 401: + return .ok(.init(body: body)) + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1335,10 +1210,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .internalServerError(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1357,10 +1232,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .unauthorized(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1379,10 +1254,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.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: [ @@ -1392,7 +1267,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) @@ -1401,7 +1276,9 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1414,61 +1291,60 @@ public struct Client: APIProtocol { } ) } - /// List repositories enabled for Copilot coding agent in an organization + /// Add users to the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. + /// Purchases a GitHub Copilot seat for each user specified. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// Organization owners can use this endpoint when the coding agent repository policy - /// is set to `selected` to see which repositories have been enabled. + /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// The response contains the total number of new seats that were created and existing seats that were refreshed. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. - public func copilotListCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. + public func copilotAddCopilotSeatsForUsers(_ input: Operations.CopilotAddCopilotSeatsForUsers.Input) async throws -> Operations.CopilotAddCopilotSeatsForUsers.Output { try await client.send( input: input, - forOperation: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.id, + forOperation: Operations.CopilotAddCopilotSeatsForUsers.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/coding-agent/permissions/repositories", + template: "/orgs/{}/copilot/billing/selected_users", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "per_page", - value: input.query.perPage - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "page", - value: input.query.page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body + let body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1478,7 +1354,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body.JsonPayload.self, + Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1487,7 +1363,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -1576,8 +1452,1228 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 409: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Remove users from the Copilot subscription for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. + /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// The response contains the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. + public func copilotCancelCopilotSeatAssignmentForUsers(_ input: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input) async throws -> Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotCancelCopilotSeatAssignmentForUsers.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/billing/selected_users", + 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 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.CopilotCancelCopilotSeatAssignmentForUsers.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 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 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about which repositories in an organization have been enabled + /// or disabled for the Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. + public func copilotGetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions", + 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.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.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 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 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set Copilot coding agent permissions for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets the policy for which repositories in an organization can use Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. + public func copilotSetCopilotCodingAgentPermissionsOrganization(_ input: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 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 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.ValidationFailed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ValidationError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// List repositories enabled for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. + /// + /// Organization owners can use this endpoint when the coding agent repository policy + /// is set to `selected` to see which repositories have been enabled. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. + public func copilotListCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions/repositories", + 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: "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.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.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 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 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 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)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Set selected repositories for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Replaces the list of selected repositories that are enabled for Copilot coding + /// agent in an organization. This method can only be called when the coding agent + /// repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. + public func copilotSetCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions/repositories", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 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 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 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 + ) + ) + } + } + ) + } + /// Enable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Adds a repository to the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. + public func copilotEnableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .put + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 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 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 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 + ) + ) + } + } + ) + } + /// Disable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Removes a repository from the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. + public func copilotDisableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/coding-agent/permissions/repositories/{}", + parameters: [ + input.path.org, + input.path.repositoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 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 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.RequiresAuthentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, @@ -1610,57 +2706,52 @@ public struct Client: APIProtocol { } ) } - /// Set selected repositories for Copilot coding agent in an organization + /// Get Copilot content exclusion rules for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Replaces the list of selected repositories that are enabled for Copilot coding - /// agent in an organization. This method can only be called when the coding agent - /// repository policy is set to `selected`. + /// Gets information about an organization's Copilot content exclusion path rules. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Organization owners can view details about Copilot content exclusion rules for the organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. - public func copilotSetCopilotCodingAgentSelectedRepositoriesForOrganization(_ input: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input) async throws -> Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. + /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. + public func copilotCopilotContentExclusionForOrganization(_ input: Operations.CopilotCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotCopilotContentExclusionForOrganization.Output { try await client.send( input: input, - forOperation: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.id, + forOperation: Operations.CopilotCopilotContentExclusionForOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/coding-agent/permissions/repositories", + template: "/orgs/{}/copilot/content_exclusion", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 500: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body + let body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1670,7 +2761,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + Components.Schemas.CopilotOrganizationContentExclusionDetails.self, from: responseBody, transforming: { value in .json(value) @@ -1679,10 +2770,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .internalServerError(.init(body: body)) - case 401: + return .ok(.init(body: body)) + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1701,10 +2792,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .internalServerError(.init(body: body)) + case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.RequiresAuthentication.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1723,10 +2814,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .unauthorized(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.NotFound.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1745,10 +2836,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 409: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Conflict.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1767,29 +2858,7 @@ public struct Client: APIProtocol { 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)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -1802,29 +2871,34 @@ public struct Client: APIProtocol { } ) } - /// Enable a repository for Copilot coding agent in an organization + /// Set Copilot content exclusion rules for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Adds a repository to the list of selected repositories enabled for Copilot - /// coding agent in an organization. This method can only be called when the - /// coding agent repository policy is set to `selected`. + /// Sets Copilot content exclusion path rules for an organization. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Organization owners can set Copilot content exclusion rules for the organization. /// - /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. - public func copilotEnableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output { + /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. + /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. + public func copilotSetCopilotContentExclusionForOrganization(_ input: Operations.CopilotSetCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotSetCopilotContentExclusionForOrganization.Output { try await client.send( input: input, - forOperation: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.id, + forOperation: Operations.CopilotSetCopilotContentExclusionForOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/coding-agent/permissions/repositories/{}", + template: "/orgs/{}/copilot/content_exclusion", parameters: [ - input.path.org, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -1836,12 +2910,41 @@ public struct Client: APIProtocol { 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 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.CopilotSetCopilotContentExclusionForOrganization.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 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.InternalError.Body @@ -1930,9 +3033,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 409: + case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Conflict.Body + let body: Components.Responses.TooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1951,10 +3054,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .conflict(.init(body: body)) + return .contentTooLarge(.init(body: body)) case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailed.Body + let body: Components.Responses.ValidationFailedSimple.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1964,7 +3067,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationError.self, + Components.Schemas.ValidationErrorSimple.self, from: responseBody, transforming: { value in .json(value) @@ -1986,36 +3089,68 @@ public struct Client: APIProtocol { } ) } - /// Disable a repository for Copilot coding agent in an organization + /// Get Copilot metrics for an organization + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// Removes a repository from the list of selected repositories enabled for Copilot - /// coding agent in an organization. This method can only be called when the - /// coding agent repository policy is set to `selected`. + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. - public func copilotDisableCopilotCodingAgentForRepositoryInOrganization(_ input: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input) async throws -> Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. + public func copilotCopilotMetricsForOrganization(_ input: Operations.CopilotCopilotMetricsForOrganization.Input) async throws -> Operations.CopilotCopilotMetricsForOrganization.Output { try await client.send( input: input, - forOperation: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.id, + forOperation: Operations.CopilotCopilotMetricsForOrganization.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/coding-agent/permissions/repositories/{}", + template: "/orgs/{}/copilot/metrics", parameters: [ - input.path.org, - input.path.repositoryId + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) + 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 @@ -2024,11 +3159,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) - case 500: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.InternalError.Body + let body: Operations.CopilotCopilotMetricsForOrganization.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2038,7 +3171,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, + [Components.Schemas.CopilotUsageMetricsDay].self, from: responseBody, transforming: { value in .json(value) @@ -2046,11 +3179,11 @@ public struct Client: APIProtocol { ) default: preconditionFailure("bestContentType chose an invalid content type.") - } - return .internalServerError(.init(body: body)) - case 401: + } + return .ok(.init(body: body)) + case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.InternalError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2069,7 +3202,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) + return .internalServerError(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -2114,9 +3247,9 @@ 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: Components.Responses.UsageMetricsApiDisabled.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2135,7 +3268,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .conflict(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2148,32 +3281,27 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot content exclusion rules for an organization + /// Get Copilot organization usage metrics for a specific day /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Use this endpoint to retrieve download links for the Copilot organization usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the organization. /// - /// Gets information about an organization's Copilot content exclusion path rules. - /// To configure these settings, go to the organization's settings on GitHub. - /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time. /// - /// Organization owners can view details about Copilot content exclusion rules for the organization. + /// 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. /// - /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. + /// 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. /// - /// > [!CAUTION] - /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. - /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. + /// 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/content_exclusion`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. - public func copilotCopilotContentExclusionForOrganization(_ input: Operations.CopilotCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotCopilotContentExclusionForOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/organization-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)`. + public func copilotCopilotOrganizationOneDayUsageMetrics(_ input: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Output { try await client.send( input: input, - forOperation: Operations.CopilotCopilotContentExclusionForOrganization.id, + forOperation: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/content_exclusion", + template: "/orgs/{}/copilot/metrics/reports/organization-1-day", parameters: [ input.path.org ] @@ -2183,6 +3311,13 @@ public struct Client: APIProtocol { 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 @@ -2193,7 +3328,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body + let body: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2203,7 +3338,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.CopilotOrganizationContentExclusionDetails.self, + Components.Schemas.CopilotUsageMetrics1DayReport.self, from: responseBody, transforming: { value in .json(value) @@ -2213,6 +3348,8 @@ public struct Client: APIProtocol { 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 @@ -2235,28 +3372,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unauthorized(.init(body: body)) case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.Forbidden.Body @@ -2313,61 +3428,47 @@ public struct Client: APIProtocol { } ) } - /// Set Copilot content exclusion rules for an organization + /// Get Copilot organization usage metrics /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Use this endpoint to retrieve download links for the latest 28-day organization Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the organization. /// - /// Sets Copilot content exclusion path rules for an organization. - /// To configure these settings, go to the organization's settings on GitHub. - /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time. /// - /// Organization owners can set Copilot content exclusion rules for the organization. + /// The response includes download links to the report files, along with the specific date range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed. /// - /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. + /// 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. /// - /// > [!CAUTION] - /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. - /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. + /// 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 `PUT /orgs/{org}/copilot/content_exclusion`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. - public func copilotSetCopilotContentExclusionForOrganization(_ input: Operations.CopilotSetCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotSetCopilotContentExclusionForOrganization.Output { + /// - 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)`. + public func copilotCopilotOrganizationUsageMetrics(_ input: Operations.CopilotCopilotOrganizationUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationUsageMetrics.Output { try await client.send( input: input, - forOperation: Operations.CopilotSetCopilotContentExclusionForOrganization.id, + forOperation: Operations.CopilotCopilotOrganizationUsageMetrics.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/content_exclusion", + template: "/orgs/{}/copilot/metrics/reports/organization-28-day/latest", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body + let body: Operations.CopilotCopilotOrganizationUsageMetrics.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2377,7 +3478,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body.JsonPayload.self, + Components.Schemas.CopilotUsageMetrics28DayReport.self, from: responseBody, transforming: { value in .json(value) @@ -2409,9 +3510,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.RequiresAuthentication.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2430,10 +3531,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.Forbidden.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2452,10 +3553,91 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get Copilot organization users usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. + /// + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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/users-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)`. + public func copilotCopilotOrganizationUsersOneDayUsageMetrics(_ input: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Output { + try await client.send( + input: input, + forOperation: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/metrics/reports/users-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: Components.Responses.NotFound.Body + let body: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.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: [ @@ -2474,10 +3656,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 413: + return .internalServerError(.init(body: body)) + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.TooLarge.Body + let body: Components.Responses.Forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2496,10 +3678,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .contentTooLarge(.init(body: body)) - case 422: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.ValidationFailedSimple.Body + let body: Components.Responses.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2509,7 +3691,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.ValidationErrorSimple.self, + Components.Schemas.BasicError.self, from: responseBody, transforming: { value in .json(value) @@ -2518,7 +3700,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unprocessableContent(.init(body: body)) + return .notFound(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -2531,31 +3713,27 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot metrics for an organization + /// Get Copilot organization users usage metrics /// - /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// Use this endpoint to retrieve download links for the latest 28-day organization users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. /// - /// > [!NOTE] - /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. /// - /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, - /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, - /// they must have telemetry enabled in their IDE. + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed. /// - /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. - /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. + /// 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. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes 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`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. - public func copilotCopilotMetricsForOrganization(_ input: Operations.CopilotCopilotMetricsForOrganization.Input) async throws -> Operations.CopilotCopilotMetricsForOrganization.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)`. + public func copilotCopilotOrganizationUsersUsageMetrics(_ input: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationUsersUsageMetrics.Output { try await client.send( input: input, - forOperation: Operations.CopilotCopilotMetricsForOrganization.id, + forOperation: Operations.CopilotCopilotOrganizationUsersUsageMetrics.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/metrics", + template: "/orgs/{}/copilot/metrics/reports/users-28-day/latest", parameters: [ input.path.org ] @@ -2565,34 +3743,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "since", - value: input.query.since - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "until", - value: input.query.until - ) - 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 @@ -2603,7 +3753,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotCopilotMetricsForOrganization.Output.Ok.Body + let body: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -2613,7 +3763,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.CopilotUsageMetricsDay].self, + Components.Schemas.CopilotUsageMetrics28DayReport.self, from: responseBody, transforming: { value in .json(value) @@ -2689,28 +3839,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.UsageMetricsApiDisabled.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.BasicError.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index 8699db47c3..5296313674 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -11,6 +11,58 @@ import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. public protocol APIProtocol: Sendable { + /// Get Copilot enterprise usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot enterprise usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the enterprise. + /// + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. + /// + /// 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/enterprise-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)`. + func copilotCopilotEnterpriseOneDayUsageMetrics(_ input: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Output + /// Get Copilot enterprise usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day enterprise Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the enterprise. + /// + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/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 users usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. + /// + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. + /// + /// 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/users-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)`. + func copilotCopilotUsersOneDayUsageMetrics(_ input: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotUsersOneDayUsageMetrics.Output + /// Get Copilot users usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day enterprise users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. + /// + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/users-28-day/latest`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)`. + func copilotCopilotUsersUsageMetrics(_ input: Operations.CopilotCopilotUsersUsageMetrics.Input) async throws -> Operations.CopilotCopilotUsersUsageMetrics.Output /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] @@ -264,6 +316,66 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics`. /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. func copilotCopilotMetricsForOrganization(_ input: Operations.CopilotCopilotMetricsForOrganization.Input) async throws -> Operations.CopilotCopilotMetricsForOrganization.Output + /// Get Copilot organization usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the organization. + /// + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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/organization-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)`. + func copilotCopilotOrganizationOneDayUsageMetrics(_ input: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Output + /// Get Copilot organization usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day organization Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the organization. + /// + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/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 users usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. + /// + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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/users-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)`. + func copilotCopilotOrganizationUsersOneDayUsageMetrics(_ input: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Output + /// Get Copilot organization users usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day organization users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. + /// + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/users-28-day/latest`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)`. + func copilotCopilotOrganizationUsersUsageMetrics(_ input: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input) async throws -> Operations.CopilotCopilotOrganizationUsersUsageMetrics.Output /// Get Copilot seat assignment details for a user /// /// > [!NOTE] @@ -304,6 +416,94 @@ public protocol APIProtocol: Sendable { /// Convenience overloads for operation inputs. extension APIProtocol { + /// Get Copilot enterprise usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot enterprise usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the enterprise. + /// + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. + /// + /// 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/enterprise-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)`. + public func copilotCopilotEnterpriseOneDayUsageMetrics( + path: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Output { + try await copilotCopilotEnterpriseOneDayUsageMetrics(Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get Copilot enterprise usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day enterprise Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the enterprise. + /// + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/enterprise-28-day/latest`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/get(copilot/copilot-enterprise-usage-metrics)`. + public func copilotCopilotEnterpriseUsageMetrics( + path: Operations.CopilotCopilotEnterpriseUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotEnterpriseUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotEnterpriseUsageMetrics.Output { + try await copilotCopilotEnterpriseUsageMetrics(Operations.CopilotCopilotEnterpriseUsageMetrics.Input( + path: path, + headers: headers + )) + } + /// Get Copilot users usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. + /// + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. + /// + /// 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/users-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)`. + public func copilotCopilotUsersOneDayUsageMetrics( + path: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotUsersOneDayUsageMetrics.Output { + try await copilotCopilotUsersOneDayUsageMetrics(Operations.CopilotCopilotUsersOneDayUsageMetrics.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get Copilot users usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day enterprise users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. + /// + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/users-28-day/latest`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)`. + public func copilotCopilotUsersUsageMetrics( + path: Operations.CopilotCopilotUsersUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotUsersUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotUsersUsageMetrics.Output { + try await copilotCopilotUsersUsageMetrics(Operations.CopilotCopilotUsersUsageMetrics.Input( + path: path, + headers: headers + )) + } /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] @@ -697,6 +897,102 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot organization usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the organization. + /// + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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/organization-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)`. + public func copilotCopilotOrganizationOneDayUsageMetrics( + path: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Output { + try await copilotCopilotOrganizationOneDayUsageMetrics(Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get Copilot organization usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day organization Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the organization. + /// + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/organization-28-day/latest`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-28-day/latest/get(copilot/copilot-organization-usage-metrics)`. + public func copilotCopilotOrganizationUsageMetrics( + path: Operations.CopilotCopilotOrganizationUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotOrganizationUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotOrganizationUsageMetrics.Output { + try await copilotCopilotOrganizationUsageMetrics(Operations.CopilotCopilotOrganizationUsageMetrics.Input( + path: path, + headers: headers + )) + } + /// Get Copilot organization users usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. + /// + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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/users-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)`. + public func copilotCopilotOrganizationUsersOneDayUsageMetrics( + path: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Output { + try await copilotCopilotOrganizationUsersOneDayUsageMetrics(Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get Copilot organization users usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day organization users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. + /// + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/users-28-day/latest`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)`. + public func copilotCopilotOrganizationUsersUsageMetrics( + path: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input.Headers = .init() + ) async throws -> Operations.CopilotCopilotOrganizationUsersUsageMetrics.Output { + try await copilotCopilotOrganizationUsersUsageMetrics(Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input( + path: path, + headers: headers + )) + } /// Get Copilot seat assignment details for a user /// /// > [!NOTE] @@ -1302,6 +1598,72 @@ public enum Components { case htmlUrl = "html_url" } } + /// Links to download the Copilot usage metrics report for an enterprise/organization for a specific day. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-1-day-report`. + public struct CopilotUsageMetrics1DayReport: Codable, Hashable, Sendable { + /// The URLs to download the Copilot usage metrics report for the enterprise/organization for the specified day. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-1-day-report/download_links`. + public var downloadLinks: [Swift.String] + /// The day of the report in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-1-day-report/report_day`. + public var reportDay: Swift.String + /// Creates a new `CopilotUsageMetrics1DayReport`. + /// + /// - Parameters: + /// - downloadLinks: The URLs to download the Copilot usage metrics report for the enterprise/organization for the specified day. + /// - reportDay: The day of the report in `YYYY-MM-DD` format. + public init( + downloadLinks: [Swift.String], + reportDay: Swift.String + ) { + self.downloadLinks = downloadLinks + self.reportDay = reportDay + } + public enum CodingKeys: String, CodingKey { + case downloadLinks = "download_links" + case reportDay = "report_day" + } + } + /// Links to download the latest Copilot usage metrics report for an enterprise/organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-28-day-report`. + public struct CopilotUsageMetrics28DayReport: Codable, Hashable, Sendable { + /// The URLs to download the latest Copilot usage metrics report for the enterprise/organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-28-day-report/download_links`. + public var downloadLinks: [Swift.String] + /// The start date of the report period in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-28-day-report/report_start_day`. + public var reportStartDay: Swift.String + /// The end date of the report period in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-28-day-report/report_end_day`. + public var reportEndDay: Swift.String + /// Creates a new `CopilotUsageMetrics28DayReport`. + /// + /// - Parameters: + /// - downloadLinks: The URLs to download the latest Copilot usage metrics report for the enterprise/organization. + /// - reportStartDay: The start date of the report period in `YYYY-MM-DD` format. + /// - reportEndDay: The end date of the report period in `YYYY-MM-DD` format. + public init( + downloadLinks: [Swift.String], + reportStartDay: Swift.String, + reportEndDay: Swift.String + ) { + self.downloadLinks = downloadLinks + self.reportStartDay = reportStartDay + self.reportEndDay = reportEndDay + } + public enum CodingKeys: String, CodingKey { + case downloadLinks = "download_links" + case reportStartDay = "report_start_day" + case reportEndDay = "report_end_day" + } + } /// Group of enterprise owners and/or members /// /// - Remark: Generated from `#/components/schemas/enterprise-team`. @@ -1874,8 +2236,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/minimal-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/minimal-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/archived`. public var archived: Swift.Bool? /// - Remark: Generated from `#/components/schemas/minimal-repository/disabled`. @@ -2094,7 +2454,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: /// - visibility: @@ -2186,7 +2545,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.MinimalRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool? = nil, disabled: Swift.Bool? = nil, visibility: Swift.String? = nil, @@ -2278,7 +2636,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2371,7 +2728,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4148,6 +4504,14 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/page`. public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The day to request data for, in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/components/parameters/day`. + public typealias Day = Swift.String /// The handle for the GitHub user account. /// /// - Remark: Generated from `#/components/parameters/username`. @@ -4365,6 +4729,10 @@ public enum Components { self.body = body } } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } public struct TooLarge: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/too_large/content`. @frozen public enum Body: Sendable, Hashable { @@ -4431,75 +4799,90 @@ public enum Components { /// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. public enum Operations { - /// Get Copilot seat information and settings for an organization + /// Get Copilot enterprise usage metrics for a specific day /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Use this endpoint to retrieve download links for the Copilot enterprise usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the enterprise. /// - /// Gets information about an organization's Copilot subscription, including seat breakdown - /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time. /// - /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. + /// 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// 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 /orgs/{org}/copilot/billing`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. - public enum CopilotGetCopilotOrganizationDetails { - public static let id: Swift.String = "copilot/get-copilot-organization-details" + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)`. + public enum CopilotCopilotEnterpriseOneDayUsageMetrics { + public static let id: Swift.String = "copilot/copilot-enterprise-one-day-usage-metrics" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The slug version of the enterprise name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path/org`. - public var org: Components.Parameters.Org + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise } } - public var path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/header`. + public var path: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-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/enterprise-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.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/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.CopilotGetCopilotOrganizationDetails.Input.Headers + public var headers: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path, - headers: Operations.CopilotGetCopilotOrganizationDetails.Input.Headers = .init() + path: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.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/billing/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CopilotOrganizationDetails) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-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.CopilotOrganizationDetails { + public var json: Components.Schemas.CopilotUsageMetrics1DayReport { get throws { switch self { case let .json(body): @@ -4509,26 +4892,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body + public var body: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body) { + public init(body: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Output.Ok.Body) { self.body = body } } - /// OK + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotGetCopilotOrganizationDetails.Output.Ok) + case ok(Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.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.CopilotGetCopilotOrganizationDetails.Output.Ok { + public var ok: Operations.CopilotCopilotEnterpriseOneDayUsageMetrics.Output.Ok { get throws { switch self { case let .ok(response): @@ -4543,7 +4926,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -4564,32 +4947,9 @@ public enum Operations { } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4612,7 +4972,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day/get(copilot/copilot-enterprise-one-day-usage-metrics)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -4633,56 +4993,21 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// There is a problem with your account's associated payment method. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotGetCopilotOrganizationDetails.Output.UnprocessableContent) - /// There is a problem with your account's associated payment method. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. + /// Undocumented response. /// - /// 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.CopilotGetCopilotOrganizationDetails.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) - } + /// 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 { @@ -4699,141 +5024,72 @@ public enum Operations { } } } - /// List all Copilot seat assignments for an organization + /// Get Copilot enterprise usage metrics /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Use this endpoint to retrieve download links for the latest 28-day enterprise Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the enterprise. /// - /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. - /// Only organization owners can view assigned seats. + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time. /// - /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. - /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). + /// The response includes download links to the report files, along with the specific date range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// 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 /orgs/{org}/copilot/billing/seats`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. - public enum CopilotListCopilotSeats { - public static let id: Swift.String = "copilot/list-copilot-seats" + /// - 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)`. + public enum CopilotCopilotEnterpriseUsageMetrics { + public static let id: Swift.String = "copilot/copilot-enterprise-usage-metrics" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The slug version of the enterprise name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path/org`. - public var org: Components.Parameters.Org + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise /// 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.CopilotListCopilotSeats.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/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/orgs/{org}/copilot/billing/seats/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}/copilot/billing/seats/GET/query/per_page`. - public var perPage: Swift.Int? - /// 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: Swift.Int? = nil - ) { - self.page = page - self.perPage = perPage + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise } } - public var query: Operations.CopilotListCopilotSeats.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/header`. + public var path: Operations.CopilotCopilotEnterpriseUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/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.CopilotListCopilotSeats.Input.Headers + public var headers: Operations.CopilotCopilotEnterpriseUsageMetrics.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.CopilotListCopilotSeats.Input.Path, - query: Operations.CopilotListCopilotSeats.Input.Query = .init(), - headers: Operations.CopilotListCopilotSeats.Input.Headers = .init() + path: Operations.CopilotCopilotEnterpriseUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotEnterpriseUsageMetrics.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/billing/seats/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/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.CopilotListCopilotSeats.Output.Ok.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// Total number of Copilot seats for the organization currently being billed. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. - public var totalSeats: Swift.Int? - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/seats`. - public var seats: [Components.Schemas.CopilotSeatDetails]? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - totalSeats: Total number of Copilot seats for the organization currently being billed. - /// - seats: - public init( - totalSeats: Swift.Int? = nil, - seats: [Components.Schemas.CopilotSeatDetails]? = nil - ) { - self.totalSeats = totalSeats - self.seats = seats - } - public enum CodingKeys: String, CodingKey { - case totalSeats = "total_seats" - case seats - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/application\/json`. - case json(Operations.CopilotListCopilotSeats.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotUsageMetrics28DayReport) /// 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.CopilotListCopilotSeats.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.CopilotUsageMetrics28DayReport { get throws { switch self { case let .json(body): @@ -4843,31 +5099,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotListCopilotSeats.Output.Ok.Body + public var body: Operations.CopilotCopilotEnterpriseUsageMetrics.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.CopilotListCopilotSeats.Output.Ok.Headers = .init(), - body: Operations.CopilotListCopilotSeats.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.CopilotCopilotEnterpriseUsageMetrics.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/get(copilot/copilot-enterprise-usage-metrics)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotListCopilotSeats.Output.Ok) + case ok(Operations.CopilotCopilotEnterpriseUsageMetrics.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.CopilotListCopilotSeats.Output.Ok { + public var ok: Operations.CopilotCopilotEnterpriseUsageMetrics.Output.Ok { get throws { switch self { case let .ok(response): @@ -4882,7 +5133,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/get(copilot/copilot-enterprise-usage-metrics)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -4903,32 +5154,9 @@ public enum Operations { } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/get(copilot/copilot-enterprise-usage-metrics)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -4951,7 +5179,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest/get(copilot/copilot-enterprise-usage-metrics)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -5003,121 +5231,90 @@ public enum Operations { } } } - /// Add teams to the Copilot subscription for an organization - /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Get Copilot users usage metrics for a specific day /// - /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." + /// Use this endpoint to retrieve download links for the Copilot user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. /// - /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." - /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. /// - /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// 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. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// 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 `POST /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. - public enum CopilotAddCopilotSeatsForTeams { - public static let id: Swift.String = "copilot/add-copilot-seats-for-teams" + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)`. + public enum CopilotCopilotUsersOneDayUsageMetrics { + public static let id: Swift.String = "copilot/copilot-users-one-day-usage-metrics" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-1-day/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The slug version of the enterprise name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/path/org`. - public var org: Components.Parameters.Org + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-1-day/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise } } - public var path: Operations.CopilotAddCopilotSeatsForTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/header`. + public var path: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-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/users-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.CopilotCopilotUsersOneDayUsageMetrics.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-1-day/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.CopilotAddCopilotSeatsForTeams.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// List of team names within the organization to which to grant access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json/selected_teams`. - public var selectedTeams: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedTeams: List of team names within the organization to which to grant access to GitHub Copilot. - public init(selectedTeams: [Swift.String]) { - self.selectedTeams = selectedTeams - } - public enum CodingKeys: String, CodingKey { - case selectedTeams = "selected_teams" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForTeams.Input.Body.JsonPayload) - } - public var body: Operations.CopilotAddCopilotSeatsForTeams.Input.Body + public var headers: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.CopilotAddCopilotSeatsForTeams.Input.Path, - headers: Operations.CopilotAddCopilotSeatsForTeams.Input.Headers = .init(), - body: Operations.CopilotAddCopilotSeatsForTeams.Input.Body + path: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotUsersOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotUsersOneDayUsageMetrics.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/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-1-day/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seats created for members of the specified team(s). - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json/seats_created`. - public var seatsCreated: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - seatsCreated: - public init(seatsCreated: Swift.Int) { - self.seatsCreated = seatsCreated - } - public enum CodingKeys: String, CodingKey { - case seatsCreated = "seats_created" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-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: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload { + public var json: Components.Schemas.CopilotUsageMetrics1DayReport { get throws { switch self { case let .json(body): @@ -5127,33 +5324,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.CopilotCopilotUsersOneDayUsageMetrics.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body) { + public init(body: Operations.CopilotCopilotUsersOneDayUsageMetrics.Output.Ok.Body) { self.body = body } } - /// OK + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/201`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.CopilotAddCopilotSeatsForTeams.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotUsersOneDayUsageMetrics.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.CopilotAddCopilotSeatsForTeams.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.CopilotCopilotUsersOneDayUsageMetrics.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 ) } @@ -5161,7 +5358,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -5182,32 +5379,9 @@ public enum Operations { } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5230,7 +5404,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-1-day/get(copilot/copilot-users-one-day-usage-metrics)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -5251,41 +5425,6 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotAddCopilotSeatsForTeams.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/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.CopilotAddCopilotSeatsForTeams.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. @@ -5317,120 +5456,72 @@ public enum Operations { } } } - /// Remove teams from the Copilot subscription for an organization - /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Get Copilot users usage metrics /// - /// Sets seats for all members of each team specified to "pending cancellation". - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. - /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." + /// Use this endpoint to retrieve download links for the latest 28-day enterprise users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise. /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. /// - /// The response contains the total number of seats set to "pending cancellation". + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// 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 `DELETE /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. - public enum CopilotCancelCopilotSeatAssignmentForTeams { - public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-teams" + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)`. + public enum CopilotCopilotUsersUsageMetrics { + public static let id: Swift.String = "copilot/copilot-users-usage-metrics" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/GET/path`. public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. + /// The slug version of the enterprise name. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/path/org`. - public var org: Components.Parameters.Org + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/GET/path/enterprise`. + public var enterprise: Components.Parameters.Enterprise /// Creates a new `Path`. /// /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - public init(org: Components.Parameters.Org) { - self.org = org + /// - enterprise: The slug version of the enterprise name. + public init(enterprise: Components.Parameters.Enterprise) { + self.enterprise = enterprise } } - public var path: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/header`. + public var path: Operations.CopilotCopilotUsersUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/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.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The names of teams from which to revoke access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json/selected_teams`. - public var selectedTeams: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedTeams: The names of teams from which to revoke access to GitHub Copilot. - public init(selectedTeams: [Swift.String]) { - self.selectedTeams = selectedTeams - } - public enum CodingKeys: String, CodingKey { - case selectedTeams = "selected_teams" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body.JsonPayload) - } - public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body + public var headers: Operations.CopilotCopilotUsersUsageMetrics.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path, - headers: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers = .init(), - body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body + path: Operations.CopilotCopilotUsersUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotUsersUsageMetrics.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}/copilot/billing/selected_teams/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seats set to "pending cancellation" for members of the specified team(s). - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json/seats_cancelled`. - public var seatsCancelled: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - seatsCancelled: - public init(seatsCancelled: Swift.Int) { - self.seatsCancelled = seatsCancelled - } - public enum CodingKeys: String, CodingKey { - case seatsCancelled = "seats_cancelled" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotUsageMetrics28DayReport) /// 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.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.CopilotUsageMetrics28DayReport { get throws { switch self { case let .json(body): @@ -5440,26 +5531,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body + public var body: Operations.CopilotCopilotUsersUsageMetrics.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body) { + public init(body: Operations.CopilotCopilotUsersUsageMetrics.Output.Ok.Body) { self.body = body } } - /// OK + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok) + case ok(Operations.CopilotCopilotUsersUsageMetrics.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.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok { + public var ok: Operations.CopilotCopilotUsersUsageMetrics.Output.Ok { get throws { switch self { case let .ok(response): @@ -5474,7 +5565,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -5495,32 +5586,9 @@ public enum Operations { } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5543,7 +5611,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-users-usage-metrics)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -5564,41 +5632,6 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/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.CopilotCancelCopilotSeatAssignmentForTeams.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. @@ -5630,32 +5663,29 @@ public enum Operations { } } } - /// Add users to the Copilot subscription for an organization + /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Purchases a GitHub Copilot seat for each user specified. - /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." - /// - /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." - /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." + /// Gets information about an organization's Copilot subscription, including seat breakdown + /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)." /// - /// The response contains the total number of new seats that were created and existing seats that were refreshed. + /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. - public enum CopilotAddCopilotSeatsForUsers { - public static let id: Swift.String = "copilot/add-copilot-seats-for-users" + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. + public enum CopilotGetCopilotOrganizationDetails { + public static let id: Swift.String = "copilot/get-copilot-organization-details" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -5665,86 +5695,43 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/header`. + public var path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/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.CopilotAddCopilotSeatsForUsers.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The usernames of the organization members to be granted access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json/selected_usernames`. - public var selectedUsernames: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedUsernames: The usernames of the organization members to be granted access to GitHub Copilot. - public init(selectedUsernames: [Swift.String]) { - self.selectedUsernames = selectedUsernames - } - public enum CodingKeys: String, CodingKey { - case selectedUsernames = "selected_usernames" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForUsers.Input.Body.JsonPayload) - } - public var body: Operations.CopilotAddCopilotSeatsForUsers.Input.Body + public var headers: Operations.CopilotGetCopilotOrganizationDetails.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path, - headers: Operations.CopilotAddCopilotSeatsForUsers.Input.Headers = .init(), - body: Operations.CopilotAddCopilotSeatsForUsers.Input.Body + path: Operations.CopilotGetCopilotOrganizationDetails.Input.Path, + headers: Operations.CopilotGetCopilotOrganizationDetails.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/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// The total number of seats created for the specified user(s). - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json/seats_created`. - public var seatsCreated: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - seatsCreated: - public init(seatsCreated: Swift.Int) { - self.seatsCreated = seatsCreated - } - public enum CodingKeys: String, CodingKey { - case seatsCreated = "seats_created" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/application\/json`. - case json(Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotOrganizationDetails) /// 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.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload { + public var json: Components.Schemas.CopilotOrganizationDetails { get throws { switch self { case let .json(body): @@ -5754,33 +5741,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body) { + public init(body: Operations.CopilotGetCopilotOrganizationDetails.Output.Ok.Body) { self.body = body } } /// OK /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/201`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.CopilotAddCopilotSeatsForUsers.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotGetCopilotOrganizationDetails.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.CopilotAddCopilotSeatsForUsers.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.CopilotGetCopilotOrganizationDetails.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 ) } @@ -5788,7 +5775,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -5811,7 +5798,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -5834,7 +5821,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -5857,7 +5844,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -5882,15 +5869,15 @@ public enum Operations { /// Creates a new `UnprocessableContent`. public init() {} } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// There is a problem with your account's associated payment method. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + case unprocessableContent(Operations.CopilotGetCopilotOrganizationDetails.Output.UnprocessableContent) + /// There is a problem with your account's associated payment method. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. public static var unprocessableContent: Self { @@ -5900,7 +5887,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent { + public var unprocessableContent: Operations.CopilotGetCopilotOrganizationDetails.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -5944,31 +5931,29 @@ public enum Operations { } } } - /// Remove users from the Copilot subscription for an organization + /// List all Copilot seat assignments for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Sets seats for all users specified to "pending cancellation". - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. - /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." - /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// Lists all Copilot seats for which an organization with a Copilot Business or Copilot Enterprise subscription is currently being billed. + /// Only organization owners can view assigned seats. /// - /// The response contains the total number of seats set to "pending cancellation". + /// Each seat object contains information about the assigned user's most recent Copilot activity. Users must have telemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. + /// For more information about activity data, see [Metrics data properties for GitHub Copilot](https://docs.github.com/copilot/reference/metrics-data). /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. - public enum CopilotCancelCopilotSeatAssignmentForUsers { - public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-users" + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. + public enum CopilotListCopilotSeats { + public static let id: Swift.String = "copilot/list-copilot-seats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -5978,86 +5963,109 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/header`. + public var path: Operations.CopilotListCopilotSeats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/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/orgs/{org}/copilot/billing/seats/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}/copilot/billing/seats/GET/query/per_page`. + public var perPage: Swift.Int? + /// 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: Swift.Int? = nil + ) { + self.page = page + self.perPage = perPage + } + } + public var query: Operations.CopilotListCopilotSeats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/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.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// The usernames of the organization members for which to revoke access to GitHub Copilot. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json/selected_usernames`. - public var selectedUsernames: [Swift.String] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - selectedUsernames: The usernames of the organization members for which to revoke access to GitHub Copilot. - public init(selectedUsernames: [Swift.String]) { - self.selectedUsernames = selectedUsernames - } - public enum CodingKeys: String, CodingKey { - case selectedUsernames = "selected_usernames" - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body.JsonPayload) - } - public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body + public var headers: Operations.CopilotListCopilotSeats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path, - headers: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers = .init(), - body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body + path: Operations.CopilotListCopilotSeats.Input.Path, + query: Operations.CopilotListCopilotSeats.Input.Query = .init(), + headers: Operations.CopilotListCopilotSeats.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/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// The total number of seats set to "pending cancellation" for the specified users. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/headers/Link`. + public var link: Components.Headers.Link? + /// Creates a new `Headers`. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json`. + /// - Parameters: + /// - link: + public init(link: Components.Headers.Link? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.CopilotListCopilotSeats.Output.Ok.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json/seats_cancelled`. - public var seatsCancelled: Swift.Int + /// Total number of Copilot seats for the organization currently being billed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. + public var totalSeats: Swift.Int? + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/json/seats`. + public var seats: [Components.Schemas.CopilotSeatDetails]? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - seatsCancelled: - public init(seatsCancelled: Swift.Int) { - self.seatsCancelled = seatsCancelled + /// - totalSeats: Total number of Copilot seats for the organization currently being billed. + /// - seats: + public init( + totalSeats: Swift.Int? = nil, + seats: [Components.Schemas.CopilotSeatDetails]? = nil + ) { + self.totalSeats = totalSeats + self.seats = seats } public enum CodingKeys: String, CodingKey { - case seatsCancelled = "seats_cancelled" + case totalSeats = "total_seats" + case seats } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/application\/json`. - case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/seats/GET/responses/200/content/application\/json`. + case json(Operations.CopilotListCopilotSeats.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.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body.JsonPayload { + public var json: Operations.CopilotListCopilotSeats.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -6067,26 +6075,31 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body + public var body: Operations.CopilotListCopilotSeats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: + /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init(body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body) { + public init( + headers: Operations.CopilotListCopilotSeats.Output.Ok.Headers = .init(), + body: Operations.CopilotListCopilotSeats.Output.Ok.Body + ) { + self.headers = headers self.body = body } } - /// OK + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok) + case ok(Operations.CopilotListCopilotSeats.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.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok { + public var ok: Operations.CopilotListCopilotSeats.Output.Ok { get throws { switch self { case let .ok(response): @@ -6101,7 +6114,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -6124,7 +6137,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -6147,7 +6160,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6170,7 +6183,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -6191,41 +6204,6 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.UnprocessableContent) - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/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.CopilotCancelCopilotSeatAssignmentForUsers.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. @@ -6257,29 +6235,32 @@ public enum Operations { } } } - /// Get Copilot coding agent permissions for an organization + /// Add teams to the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Gets information about which repositories in an organization have been enabled - /// or disabled for the Copilot coding agent. + /// Purchases a GitHub Copilot seat for all users within each specified team. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// Organization owners can configure whether Copilot coding agent is enabled for - /// all repositories, selected repositories, or no repositories owned by organization. + /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// The response contains the total number of new seats that were created and existing seats that were refreshed. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. - public enum CopilotGetCopilotCodingAgentPermissionsOrganization { - public static let id: Swift.String = "copilot/get-copilot-coding-agent-permissions-organization" + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. + public enum CopilotAddCopilotSeatsForTeams { + public static let id: Swift.String = "copilot/add-copilot-seats-for-teams" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -6289,78 +6270,86 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/header`. + public var path: Operations.CopilotAddCopilotSeatsForTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/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.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Headers + public var headers: Operations.CopilotAddCopilotSeatsForTeams.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// List of team names within the organization to which to grant access to GitHub Copilot. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/json/selected_teams`. + public var selectedTeams: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedTeams: List of team names within the organization to which to grant access to GitHub Copilot. + public init(selectedTeams: [Swift.String]) { + self.selectedTeams = selectedTeams + } + public enum CodingKeys: String, CodingKey { + case selectedTeams = "selected_teams" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/requestBody/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForTeams.Input.Body.JsonPayload) + } + public var body: Operations.CopilotAddCopilotSeatsForTeams.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Path, - headers: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Headers = .init() + path: Operations.CopilotAddCopilotSeatsForTeams.Input.Path, + headers: Operations.CopilotAddCopilotSeatsForTeams.Input.Headers = .init(), + body: Operations.CopilotAddCopilotSeatsForTeams.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}/copilot/coding-agent/permissions/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json`. + /// The total number of seats created for members of the specified team(s). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/enabled_repositories`. - @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case selected = "selected" - case none = "none" - } - /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/enabled_repositories`. - public var enabledRepositories: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.EnabledRepositoriesPayload - /// The URL for the selected repositories endpoint. Only present when `enabled_repositories` is `selected`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/selected_repositories_url`. - public var selectedRepositoriesUrl: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/json/seats_created`. + public var seatsCreated: Swift.Int /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - enabledRepositories: The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. - /// - selectedRepositoriesUrl: The URL for the selected repositories endpoint. Only present when `enabled_repositories` is `selected`. - public init( - enabledRepositories: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.EnabledRepositoriesPayload, - selectedRepositoriesUrl: Swift.String? = nil - ) { - self.enabledRepositories = enabledRepositories - self.selectedRepositoriesUrl = selectedRepositoriesUrl + /// - seatsCreated: + public init(seatsCreated: Swift.Int) { + self.seatsCreated = seatsCreated } public enum CodingKeys: String, CodingKey { - case enabledRepositories = "enabled_repositories" - case selectedRepositoriesUrl = "selected_repositories_url" + case seatsCreated = "seats_created" } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/application\/json`. - case json(Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/POST/responses/201/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForTeams.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.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload { + public var json: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -6370,33 +6359,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body) { + public init(body: Operations.CopilotAddCopilotSeatsForTeams.Output.Created.Body) { self.body = body } } - /// Response + /// OK /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.CopilotAddCopilotSeatsForTeams.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.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CopilotAddCopilotSeatsForTeams.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 ) } @@ -6404,7 +6393,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -6427,7 +6416,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -6450,7 +6439,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6473,7 +6462,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -6494,6 +6483,41 @@ public enum Operations { } } } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotAddCopilotSeatsForTeams.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)/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.CopilotAddCopilotSeatsForTeams.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. @@ -6525,28 +6549,31 @@ public enum Operations { } } } - /// Set Copilot coding agent permissions for an organization + /// Remove teams from the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Sets the policy for which repositories in an organization can use Copilot coding agent. + /// Sets seats for all members of each team specified to "pending cancellation". + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through another team. + /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// - /// Organization owners can configure whether Copilot coding agent is enabled for - /// all repositories, selected repositories, or no repositories owned by the organization. + /// Only organization owners can cancel Copilot seats for their organization members. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// The response contains the total number of seats set to "pending cancellation". /// - /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. - public enum CopilotSetCopilotCodingAgentPermissionsOrganization { - public static let id: Swift.String = "copilot/set-copilot-coding-agent-permissions-organization" + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. + public enum CopilotCancelCopilotSeatAssignmentForTeams { + public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-teams" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -6556,50 +6583,42 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/header`. + public var path: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/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.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody`. + public var headers: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json/enabled_repositories`. - @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { - case all = "all" - case selected = "selected" - case none = "none" - } - /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// The names of teams from which to revoke access to GitHub Copilot. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json/enabled_repositories`. - public var enabledRepositories: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/json/selected_teams`. + public var selectedTeams: [Swift.String] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - enabledRepositories: The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. - public init(enabledRepositories: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload) { - self.enabledRepositories = enabledRepositories + /// - selectedTeams: The names of teams from which to revoke access to GitHub Copilot. + public init(selectedTeams: [Swift.String]) { + self.selectedTeams = selectedTeams } public enum CodingKeys: String, CodingKey { - case enabledRepositories = "enabled_repositories" + case selectedTeams = "selected_teams" } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/content/application\/json`. - case json(Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/requestBody/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body.JsonPayload) } - public var body: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body + public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -6607,9 +6626,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Path, - headers: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Headers = .init(), - body: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body + path: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Path, + headers: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Headers = .init(), + body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Input.Body ) { self.path = path self.headers = headers @@ -6617,36 +6636,69 @@ public enum Operations { } } @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/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// The total number of seats set to "pending cancellation" for members of the specified team(s). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/json/seats_cancelled`. + public var seatsCancelled: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - seatsCancelled: + public init(seatsCancelled: Swift.Int) { + self.seatsCancelled = seatsCancelled + } + public enum CodingKeys: String, CodingKey { + case seatsCancelled = "seats_cancelled" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_teams/DELETE/responses/200/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForTeams.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.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.Ok.Body) { + self.body = body + } } - /// No Content - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output.NoContent) - /// No Content + /// OK /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/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.CopilotCancelCopilotSeatAssignmentForTeams.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.CopilotSetCopilotCodingAgentPermissionsOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.CopilotCancelCopilotSeatAssignmentForTeams.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 ) } @@ -6654,7 +6706,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -6677,7 +6729,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -6700,7 +6752,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -6723,7 +6775,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -6744,17 +6796,29 @@ public enum Operations { } } } - /// Validation failed, or the endpoint has been spammed. + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) + case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)/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: Components.Responses.ValidationFailed { + public var unprocessableContent: Operations.CopilotCancelCopilotSeatAssignmentForTeams.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -6798,28 +6862,32 @@ public enum Operations { } } } - /// List repositories enabled for Copilot coding agent in an organization + /// Add users to the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. + /// Purchases a GitHub Copilot seat for each user specified. + /// The organization will be billed for each seat based on the organization's Copilot plan. For more information about Copilot pricing, see "[About billing for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/about-billing-for-github-copilot-in-your-organization)." /// - /// Organization owners can use this endpoint when the coding agent repository policy - /// is set to `selected` to see which repositories have been enabled. + /// Only organization owners can purchase Copilot seats for their organization members. The organization must have a Copilot Business or Copilot Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Subscribing to Copilot for your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-the-copilot-subscription-for-your-organization/subscribing-to-copilot-for-your-organization)." + /// For more information about setting a suggestion matching policy, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#policies-for-suggestion-matching)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// The response contains the total number of new seats that were created and existing seats that were refreshed. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. - public enum CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization { - public static let id: Swift.String = "copilot/list-copilot-coding-agent-selected-repositories-for-organization" + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. + public enum CopilotAddCopilotSeatsForUsers { + public static let id: Swift.String = "copilot/add-copilot-seats-for-users" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -6829,93 +6897,86 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/query`. - public struct Query: Sendable, Hashable { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/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}/copilot/coding-agent/permissions/repositories/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.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/header`. + public var path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/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.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers + public var headers: Operations.CopilotAddCopilotSeatsForUsers.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The usernames of the organization members to be granted access to GitHub Copilot. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/json/selected_usernames`. + public var selectedUsernames: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - selectedUsernames: The usernames of the organization members to be granted access to GitHub Copilot. + public init(selectedUsernames: [Swift.String]) { + self.selectedUsernames = selectedUsernames + } + public enum CodingKeys: String, CodingKey { + case selectedUsernames = "selected_usernames" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/requestBody/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForUsers.Input.Body.JsonPayload) + } + public var body: Operations.CopilotAddCopilotSeatsForUsers.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: + /// - body: public init( - path: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, - query: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Query = .init(), - headers: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers = .init() + path: Operations.CopilotAddCopilotSeatsForUsers.Input.Path, + headers: Operations.CopilotAddCopilotSeatsForUsers.Input.Headers = .init(), + body: Operations.CopilotAddCopilotSeatsForUsers.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/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json`. + /// The total number of seats created for the specified user(s). + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json/total_count`. - public var totalCount: Swift.Int - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json/repositories`. - public var repositories: [Components.Schemas.MinimalRepository] + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/json/seats_created`. + public var seatsCreated: Swift.Int /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - totalCount: - /// - repositories: - public init( - totalCount: Swift.Int, - repositories: [Components.Schemas.MinimalRepository] - ) { - self.totalCount = totalCount - self.repositories = repositories + /// - seatsCreated: + public init(seatsCreated: Swift.Int) { + self.seatsCreated = seatsCreated } public enum CodingKeys: String, CodingKey { - case totalCount = "total_count" - case repositories + case seatsCreated = "seats_created" } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/application\/json`. - case json(Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/POST/responses/201/content/application\/json`. + case json(Operations.CopilotAddCopilotSeatsForUsers.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.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body.JsonPayload { + public var json: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -6925,33 +6986,33 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body) { + public init(body: Operations.CopilotAddCopilotSeatsForUsers.Output.Created.Body) { self.body = body } } - /// Response + /// OK /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.CopilotAddCopilotSeatsForUsers.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.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CopilotAddCopilotSeatsForUsers.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 ) } @@ -6959,7 +7020,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -6982,7 +7043,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7005,7 +7066,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7028,7 +7089,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -7049,24 +7110,36 @@ public enum Operations { } } } - /// Conflict + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/409`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/responses/422`. /// - /// HTTP response code: `409 conflict`. - case conflict(Components.Responses.Conflict) - /// The associated value of the enum case if `self` is `.conflict`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. /// - /// - Throws: An error if `self` is not `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Components.Responses.Conflict { + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)/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.CopilotAddCopilotSeatsForUsers.Output.UnprocessableContent { get throws { switch self { - case let .conflict(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "unprocessableContent", response: self ) } @@ -7103,27 +7176,31 @@ public enum Operations { } } } - /// Set selected repositories for Copilot coding agent in an organization + /// Remove users from the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Replaces the list of selected repositories that are enabled for Copilot coding - /// agent in an organization. This method can only be called when the coding agent - /// repository policy is set to `selected`. + /// Sets seats for all users specified to "pending cancellation". + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle unless they retain access through team membership. + /// For more information about disabling access to Copilot, see "[Revoking access to Copilot for members of your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)." /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// Only organization owners can cancel Copilot seats for their organization members. /// - /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. - public enum CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization { - public static let id: Swift.String = "copilot/set-copilot-coding-agent-selected-repositories-for-organization" + /// The response contains the total number of seats set to "pending cancellation". + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. + public enum CopilotCancelCopilotSeatAssignmentForUsers { + public static let id: Swift.String = "copilot/cancel-copilot-seat-assignment-for-users" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -7133,42 +7210,42 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/header`. + public var path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/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.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody`. + public var headers: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// List of repository IDs to enable for Copilot coding agent. + /// The usernames of the organization members for which to revoke access to GitHub Copilot. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/json/selected_repository_ids`. - public var selectedRepositoryIds: [Swift.Int] + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/json/selected_usernames`. + public var selectedUsernames: [Swift.String] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - selectedRepositoryIds: List of repository IDs to enable for Copilot coding agent. - public init(selectedRepositoryIds: [Swift.Int]) { - self.selectedRepositoryIds = selectedRepositoryIds + /// - selectedUsernames: The usernames of the organization members for which to revoke access to GitHub Copilot. + public init(selectedUsernames: [Swift.String]) { + self.selectedUsernames = selectedUsernames } public enum CodingKeys: String, CodingKey { - case selectedRepositoryIds = "selected_repository_ids" + case selectedUsernames = "selected_usernames" } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/content/application\/json`. - case json(Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/requestBody/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body.JsonPayload) } - public var body: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body + public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -7176,9 +7253,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, - headers: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers = .init(), - body: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body + path: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Path, + headers: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Headers = .init(), + body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Input.Body ) { self.path = path self.headers = headers @@ -7186,36 +7263,69 @@ public enum Operations { } } @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/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// The total number of seats set to "pending cancellation" for the specified users. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/json/seats_cancelled`. + public var seatsCancelled: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - seatsCancelled: + public init(seatsCancelled: Swift.Int) { + self.seatsCancelled = seatsCancelled + } + public enum CodingKeys: String, CodingKey { + case seatsCancelled = "seats_cancelled" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/billing/selected_users/DELETE/responses/200/content/application\/json`. + case json(Operations.CopilotCancelCopilotSeatAssignmentForUsers.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.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.Ok.Body) { + self.body = body + } } - /// No Content - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output.NoContent) - /// No Content + /// OK /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/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.CopilotCancelCopilotSeatAssignmentForUsers.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.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.CopilotCancelCopilotSeatAssignmentForUsers.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 ) } @@ -7223,7 +7333,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -7246,7 +7356,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7269,7 +7379,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7292,7 +7402,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -7313,40 +7423,29 @@ public enum Operations { } } } - /// Conflict + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/409`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. /// - /// HTTP response code: `409 conflict`. - case conflict(Components.Responses.Conflict) - /// The associated value of the enum case if `self` is `.conflict`. + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.UnprocessableContent) + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. /// - /// - 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}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailed) + 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: Components.Responses.ValidationFailed { + public var unprocessableContent: Operations.CopilotCancelCopilotSeatAssignmentForUsers.Output.UnprocessableContent { get throws { switch self { case let .unprocessableContent(response): @@ -7390,102 +7489,146 @@ public enum Operations { } } } - /// Enable a repository for Copilot coding agent in an organization + /// Get Copilot coding agent permissions for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Adds a repository to the list of selected repositories enabled for Copilot - /// coding agent in an organization. This method can only be called when the - /// coding agent repository policy is set to `selected`. + /// Gets information about which repositories in an organization have been enabled + /// or disabled for the Copilot coding agent. + /// + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by organization. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. - public enum CopilotEnableCopilotCodingAgentForRepositoryInOrganization { - public static let id: Swift.String = "copilot/enable-copilot-coding-agent-for-repository-in-organization" + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)`. + public enum CopilotGetCopilotCodingAgentPermissionsOrganization { + public static let id: Swift.String = "copilot/get-copilot-coding-agent-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - repositoryId: The unique identifier of the repository. - public init( - org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.repositoryId = repositoryId } } - public var path: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/header`. + public var path: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/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.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Headers + public var headers: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Path, - headers: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Headers = .init() + path: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Input.Path, + headers: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.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() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/enabled_repositories`. + @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case selected = "selected" + case none = "none" + } + /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/enabled_repositories`. + public var enabledRepositories: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.EnabledRepositoriesPayload + /// The URL for the selected repositories endpoint. Only present when `enabled_repositories` is `selected`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/json/selected_repositories_url`. + public var selectedRepositoriesUrl: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// - selectedRepositoriesUrl: The URL for the selected repositories endpoint. Only present when `enabled_repositories` is `selected`. + public init( + enabledRepositories: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload.EnabledRepositoriesPayload, + selectedRepositoriesUrl: Swift.String? = nil + ) { + self.enabledRepositories = enabledRepositories + self.selectedRepositoriesUrl = selectedRepositoriesUrl + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + case selectedRepositoriesUrl = "selected_repositories_url" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/GET/responses/200/content/application\/json`. + case json(Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.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.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.Output.Ok.Body) { + self.body = body + } } - /// No Content - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent) - /// No Content + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/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.CopilotGetCopilotCodingAgentPermissionsOrganization.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.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.CopilotGetCopilotCodingAgentPermissionsOrganization.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 ) } @@ -7493,7 +7636,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -7516,7 +7659,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7539,7 +7682,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7562,7 +7705,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/get(copilot/get-copilot-coding-agent-permissions-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -7583,52 +7726,6 @@ public enum Operations { } } } - /// Conflict - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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. @@ -7660,69 +7757,95 @@ public enum Operations { } } } - /// Disable a repository for Copilot coding agent in an organization + /// Set Copilot coding agent permissions for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Removes a repository from the list of selected repositories enabled for Copilot - /// coding agent in an organization. This method can only be called when the - /// coding agent repository policy is set to `selected`. + /// Sets the policy for which repositories in an organization can use Copilot coding agent. /// - /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. + /// Organization owners can configure whether Copilot coding agent is enabled for + /// all repositories, selected repositories, or no repositories owned by the organization. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. - public enum CopilotDisableCopilotCodingAgentForRepositoryInOrganization { - public static let id: Swift.String = "copilot/disable-copilot-coding-agent-for-repository-in-organization" + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)`. + public enum CopilotSetCopilotCodingAgentPermissionsOrganization { + public static let id: Swift.String = "copilot/set-copilot-coding-agent-permissions-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/path/org`. public var org: Components.Parameters.Org - /// The unique identifier of the repository. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/path/repository_id`. - public var repositoryId: Components.Parameters.RepositoryId /// Creates a new `Path`. /// /// - Parameters: /// - org: The organization name. The name is not case sensitive. - /// - repositoryId: The unique identifier of the repository. - public init( - org: Components.Parameters.Org, - repositoryId: Components.Parameters.RepositoryId - ) { + public init(org: Components.Parameters.Org) { self.org = org - self.repositoryId = repositoryId } } - public var path: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/header`. + public var path: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/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.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: + public var headers: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json/enabled_repositories`. + @frozen public enum EnabledRepositoriesPayload: String, Codable, Hashable, Sendable, CaseIterable { + case all = "all" + case selected = "selected" + case none = "none" + } + /// The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/json/enabled_repositories`. + public var enabledRepositories: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - enabledRepositories: The policy for which repositories can use Copilot coding agent. Can be one of `all`, `selected`, or `none`. + public init(enabledRepositories: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload.EnabledRepositoriesPayload) { + self.enabledRepositories = enabledRepositories + } + public enum CodingKeys: String, CodingKey { + case enabledRepositories = "enabled_repositories" + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/PUT/requestBody/content/application\/json`. + case json(Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body.JsonPayload) + } + public var body: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: /// - headers: + /// - body: public init( - path: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Path, - headers: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Headers = .init() + path: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Path, + headers: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -7732,13 +7855,13 @@ public enum Operations { } /// No Content /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent) + case noContent(Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output.NoContent) /// No Content /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/204`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -7748,7 +7871,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent { + public var noContent: Operations.CopilotSetCopilotCodingAgentPermissionsOrganization.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -7763,7 +7886,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -7786,7 +7909,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -7809,7 +7932,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -7832,7 +7955,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -7853,24 +7976,24 @@ public enum Operations { } } } - /// Conflict + /// Validation failed, or the endpoint has been spammed. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/409`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/put(copilot/set-copilot-coding-agent-permissions-organization)/responses/422`. /// - /// HTTP response code: `409 conflict`. - case conflict(Components.Responses.Conflict) - /// The associated value of the enum case if `self` is `.conflict`. + /// 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 `.conflict`. - /// - SeeAlso: `.conflict`. - public var conflict: Components.Responses.Conflict { + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { get throws { switch self { - case let .conflict(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "conflict", + expectedStatus: "unprocessableContent", response: self ) } @@ -7907,33 +8030,28 @@ public enum Operations { } } } - /// Get Copilot content exclusion rules for an organization + /// List repositories enabled for Copilot coding agent in an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Gets information about an organization's Copilot content exclusion path rules. - /// To configure these settings, go to the organization's settings on GitHub. - /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." - /// - /// Organization owners can view details about Copilot content exclusion rules for the organization. + /// Lists the selected repositories that are enabled for Copilot coding agent in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. + /// Organization owners can use this endpoint when the coding agent repository policy + /// is set to `selected` to see which repositories have been enabled. /// - /// > [!CAUTION] - /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. - /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/content_exclusion`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. - public enum CopilotCopilotContentExclusionForOrganization { - public static let id: Swift.String = "copilot/copilot-content-exclusion-for-organization" + /// - Remark: HTTP `GET /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)`. + public enum CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization { + public static let id: Swift.String = "copilot/list-copilot-coding-agent-selected-repositories-for-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -7943,43 +8061,93 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotCopilotContentExclusionForOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/header`. + public var path: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/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}/copilot/coding-agent/permissions/repositories/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.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/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.CopilotCopilotContentExclusionForOrganization.Input.Headers + public var headers: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.CopilotCopilotContentExclusionForOrganization.Input.Path, - headers: Operations.CopilotCopilotContentExclusionForOrganization.Input.Headers = .init() + path: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, + query: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Query = .init(), + headers: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.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/content_exclusion/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/responses/200/content/application\/json`. - case json(Components.Schemas.CopilotOrganizationContentExclusionDetails) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json/total_count`. + public var totalCount: Swift.Int + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/json/repositories`. + public var repositories: [Components.Schemas.MinimalRepository] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - totalCount: + /// - repositories: + public init( + totalCount: Swift.Int, + repositories: [Components.Schemas.MinimalRepository] + ) { + self.totalCount = totalCount + self.repositories = repositories + } + public enum CodingKeys: String, CodingKey { + case totalCount = "total_count" + case repositories + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/GET/responses/200/content/application\/json`. + case json(Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.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: Components.Schemas.CopilotOrganizationContentExclusionDetails { + public var json: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -7989,26 +8157,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body + public var body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body) { + public init(body: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok.Body) { self.body = body } } - /// OK + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok) + case ok(Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.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.CopilotCopilotContentExclusionForOrganization.Output.Ok { + public var ok: Operations.CopilotListCopilotCodingAgentSelectedRepositoriesForOrganization.Output.Ok { get throws { switch self { case let .ok(response): @@ -8023,7 +8191,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -8046,7 +8214,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.RequiresAuthentication) @@ -8069,7 +8237,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8092,7 +8260,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -8113,6 +8281,29 @@ public enum Operations { } } } + /// Conflict + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/get(copilot/list-copilot-coding-agent-selected-repositories-for-organization)/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 + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -8144,33 +8335,27 @@ public enum Operations { } } } - /// Set Copilot content exclusion rules for an organization + /// Set selected repositories for Copilot coding agent in an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Sets Copilot content exclusion path rules for an organization. - /// To configure these settings, go to the organization's settings on GitHub. - /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." - /// - /// Organization owners can set Copilot content exclusion rules for the organization. - /// - /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. + /// Replaces the list of selected repositories that are enabled for Copilot coding + /// agent in an organization. This method can only be called when the coding agent + /// repository policy is set to `selected`. /// - /// > [!CAUTION] - /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. - /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// - /// - Remark: HTTP `PUT /orgs/{org}/copilot/content_exclusion`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. - public enum CopilotSetCopilotContentExclusionForOrganization { - public static let id: Swift.String = "copilot/set-copilot-content-exclusion-for-organization" + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)`. + public enum CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization { + public static let id: Swift.String = "copilot/set-copilot-coding-agent-selected-repositories-for-organization" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -8180,198 +8365,2285 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/header`. + public var path: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/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.CopilotSetCopilotContentExclusionForOrganization.Input.Headers - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody`. + public var headers: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload`. - public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { - /// The path to the file that will be excluded. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value1`. - public var value1: Swift.String? - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2`. - public struct Value2Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2/ifAnyMatch`. - public var ifAnyMatch: [Swift.String] - /// Creates a new `Value2Payload`. - /// - /// - Parameters: - /// - ifAnyMatch: - public init(ifAnyMatch: [Swift.String]) { - self.ifAnyMatch = ifAnyMatch - } - public enum CodingKeys: String, CodingKey { - case ifAnyMatch - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.ifAnyMatch = try container.decode( - [Swift.String].self, - forKey: .ifAnyMatch - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "ifAnyMatch" - ]) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2`. - public var value2: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value2Payload? - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3`. - public struct Value3Payload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3/ifNoneMatch`. - public var ifNoneMatch: [Swift.String] - /// Creates a new `Value3Payload`. - /// - /// - Parameters: - /// - ifNoneMatch: - public init(ifNoneMatch: [Swift.String]) { - self.ifNoneMatch = ifNoneMatch - } - public enum CodingKeys: String, CodingKey { - case ifNoneMatch - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.ifNoneMatch = try container.decode( - [Swift.String].self, - forKey: .ifNoneMatch - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "ifNoneMatch" - ]) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3`. - public var value3: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value3Payload? - /// Creates a new `AdditionalPropertiesPayloadPayload`. - /// - /// - Parameters: - /// - value1: The path to the file that will be excluded. - /// - value2: - /// - value3: - public init( - value1: Swift.String? = nil, - value2: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value2Payload? = nil, - value3: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.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 decoder.decodeFromSingleValueContainer() - } 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 encoder.encodeFirstNonNilValueToSingleValueContainer([ - self.value1 - ]) - try self.value2?.encode(to: encoder) - try self.value3?.encode(to: encoder) - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/additionalProperties`. - public typealias AdditionalPropertiesPayload = [Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload] - /// A container of undocumented properties. - public var additionalProperties: [String: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayload] + /// List of repository IDs to enable for Copilot coding agent. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/json/selected_repository_ids`. + public var selectedRepositoryIds: [Swift.Int] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - additionalProperties: A container of undocumented properties. - public init(additionalProperties: [String: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayload] = .init()) { - self.additionalProperties = additionalProperties + /// - selectedRepositoryIds: List of repository IDs to enable for Copilot coding agent. + public init(selectedRepositoryIds: [Swift.Int]) { + self.selectedRepositoryIds = selectedRepositoryIds } - public init(from decoder: any Swift.Decoder) throws { - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + public enum CodingKeys: String, CodingKey { + case selectedRepositoryIds = "selected_repository_ids" } - public func encode(to encoder: any Swift.Encoder) throws { - try encoder.encodeAdditionalProperties(additionalProperties) + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/PUT/requestBody/content/application\/json`. + case json(Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body.JsonPayload) + } + public var body: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Path, + headers: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// No Content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output.NoContent) + /// No Content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/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.CopilotSetCopilotCodingAgentSelectedRepositoriesForOrganization.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) } } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/content/application\/json`. - case json(Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload) } - public var body: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/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 + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/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/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/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}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/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}/copilot/coding-agent/permissions/repositories/put(copilot/set-copilot-coding-agent-selected-repositories-for-organization)/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 + ] + } + } + } + /// Enable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Adds a repository to the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)`. + public enum CopilotEnableCopilotCodingAgentForRepositoryInOrganization { + public static let id: Swift.String = "copilot/enable-copilot-coding-agent-for-repository-in-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/PUT/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId + ) { + self.org = org + self.repositoryId = repositoryId + } + } + public var path: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/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.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Input.Path, + headers: Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.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() {} + } + /// No Content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent) + /// No Content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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.CopilotEnableCopilotCodingAgentForRepositoryInOrganization.Output.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/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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 + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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}/copilot/coding-agent/permissions/repositories/{repository_id}/put(copilot/enable-copilot-coding-agent-for-repository-in-organization)/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 + ] + } + } + } + /// Disable a repository for Copilot coding agent in an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Removes a repository from the list of selected repositories enabled for Copilot + /// coding agent in an organization. This method can only be called when the + /// coding agent repository policy is set to `selected`. + /// + /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)`. + public enum CopilotDisableCopilotCodingAgentForRepositoryInOrganization { + public static let id: Swift.String = "copilot/disable-copilot-coding-agent-for-repository-in-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/path/org`. + public var org: Components.Parameters.Org + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/DELETE/path/repository_id`. + public var repositoryId: Components.Parameters.RepositoryId + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - repositoryId: The unique identifier of the repository. + public init( + org: Components.Parameters.Org, + repositoryId: Components.Parameters.RepositoryId + ) { + self.org = org + self.repositoryId = repositoryId + } + } + public var path: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_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.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Input.Path, + headers: Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.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() {} + } + /// No Content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output.NoContent) + /// No Content + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/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.CopilotDisableCopilotCodingAgentForRepositoryInOrganization.Output.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/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/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 + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/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/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/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}/copilot/coding-agent/permissions/repositories/{repository_id}/delete(copilot/disable-copilot-coding-agent-for-repository-in-organization)/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 + ) + } + } + } + /// 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 content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets information about an organization's Copilot content exclusion path rules. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can view details about Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `copilot` or `read:org` scopes to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. This endpoint will not return any comments in the existing rules. + /// > * At this time, the API does not support duplicate keys. If your content exclusion configuration contains duplicate keys, the API will return only the last occurrence of that key. For example, if duplicate entries are present, only the final value will be included in the response. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)`. + public enum CopilotCopilotContentExclusionForOrganization { + public static let id: Swift.String = "copilot/copilot-content-exclusion-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/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.CopilotCopilotContentExclusionForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/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.CopilotCopilotContentExclusionForOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.CopilotCopilotContentExclusionForOrganization.Input.Path, + headers: Operations.CopilotCopilotContentExclusionForOrganization.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}/copilot/content_exclusion/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotOrganizationContentExclusionDetails) + /// 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.CopilotOrganizationContentExclusionDetails { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCopilotContentExclusionForOrganization.Output.Ok.Body) { + self.body = body + } + } + /// OK + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotContentExclusionForOrganization.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.CopilotCopilotContentExclusionForOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/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 + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/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/content_exclusion/get(copilot/copilot-content-exclusion-for-organization)/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 + ] + } + } + } + /// Set Copilot content exclusion rules for an organization + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Sets Copilot content exclusion path rules for an organization. + /// To configure these settings, go to the organization's settings on GitHub. + /// For more information, see "[Excluding content from GitHub Copilot](https://docs.github.com/copilot/managing-copilot/configuring-and-auditing-content-exclusion/excluding-content-from-github-copilot#configuring-content-exclusions-for-your-organization)." + /// + /// Organization owners can set Copilot content exclusion rules for the organization. + /// + /// OAuth app tokens and personal access tokens (classic) need the `copilot` scope to use this endpoint. + /// + /// > [!CAUTION] + /// > * At this time, the API does not support comments. When using this endpoint, any existing comments in your rules will be deleted. + /// > * At this time, the API does not support duplicate keys. If you submit content exclusions through the API with duplicate keys, only the last occurrence will be saved. Earlier entries with the same key will be overwritten. + /// + /// - Remark: HTTP `PUT /orgs/{org}/copilot/content_exclusion`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)`. + public enum CopilotSetCopilotContentExclusionForOrganization { + public static let id: Swift.String = "copilot/set-copilot-content-exclusion-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/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.CopilotSetCopilotContentExclusionForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/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.CopilotSetCopilotContentExclusionForOrganization.Input.Headers + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload`. + public struct AdditionalPropertiesPayloadPayload: Codable, Hashable, Sendable { + /// The path to the file that will be excluded. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2/ifAnyMatch`. + public var ifAnyMatch: [Swift.String] + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - ifAnyMatch: + public init(ifAnyMatch: [Swift.String]) { + self.ifAnyMatch = ifAnyMatch + } + public enum CodingKeys: String, CodingKey { + case ifAnyMatch + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.ifAnyMatch = try container.decode( + [Swift.String].self, + forKey: .ifAnyMatch + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "ifAnyMatch" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value2`. + public var value2: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value2Payload? + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3`. + public struct Value3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3/ifNoneMatch`. + public var ifNoneMatch: [Swift.String] + /// Creates a new `Value3Payload`. + /// + /// - Parameters: + /// - ifNoneMatch: + public init(ifNoneMatch: [Swift.String]) { + self.ifNoneMatch = ifNoneMatch + } + public enum CodingKeys: String, CodingKey { + case ifNoneMatch + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.ifNoneMatch = try container.decode( + [Swift.String].self, + forKey: .ifNoneMatch + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "ifNoneMatch" + ]) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/AdditionalPropertiesPayload/value3`. + public var value3: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value3Payload? + /// Creates a new `AdditionalPropertiesPayloadPayload`. + /// + /// - Parameters: + /// - value1: The path to the file that will be excluded. + /// - value2: + /// - value3: + public init( + value1: Swift.String? = nil, + value2: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.Value2Payload? = nil, + value3: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload.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 decoder.decodeFromSingleValueContainer() + } 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 encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1 + ]) + try self.value2?.encode(to: encoder) + try self.value3?.encode(to: encoder) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/json/additionalProperties`. + public typealias AdditionalPropertiesPayload = [Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayloadPayload] + /// A container of undocumented properties. + public var additionalProperties: [String: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.AdditionalPropertiesPayload] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload.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) + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/requestBody/content/application\/json`. + case json(Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body.JsonPayload) + } + public var body: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Path, + headers: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Headers = .init(), + body: Operations.CopilotSetCopilotContentExclusionForOrganization.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}/copilot/content_exclusion/PUT/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/json/message`. + public var message: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: + public init(message: Swift.String? = nil) { + self.message = message + } + public enum CodingKeys: String, CodingKey { + case message + } + } + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/application\/json`. + case json(Operations.CopilotSetCopilotContentExclusionForOrganization.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.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotSetCopilotContentExclusionForOrganization.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.CopilotSetCopilotContentExclusionForOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/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 + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.RequiresAuthentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.RequiresAuthentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/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/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/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 + ) + } + } + } + /// Payload Too Large + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Components.Responses.TooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Components.Responses.TooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailedSimple) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailedSimple { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get Copilot metrics for an organization + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, + /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, + /// they must have telemetry enabled in their IDE. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. + /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. + public enum CopilotCopilotMetricsForOrganization { + public static let id: Swift.String = "copilot/copilot-metrics-for-organization" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/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.CopilotCopilotMetricsForOrganization.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query`. + public struct Query: Sendable, Hashable { + /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/since`. + public var since: Swift.String? + /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/until`. + public var until: Swift.String? + /// 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}/copilot/metrics/GET/query/page`. + public var page: Components.Parameters.Page? + /// The number of days of metrics to display 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}/copilot/metrics/GET/query/per_page`. + public var perPage: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. + /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. + /// - 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 days of metrics to display 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( + since: Swift.String? = nil, + until: Swift.String? = nil, + page: Components.Parameters.Page? = nil, + perPage: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.perPage = perPage + } + } + public var query: Operations.CopilotCopilotMetricsForOrganization.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/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.CopilotCopilotMetricsForOrganization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.CopilotCopilotMetricsForOrganization.Input.Path, + query: Operations.CopilotCopilotMetricsForOrganization.Input.Query = .init(), + headers: Operations.CopilotCopilotMetricsForOrganization.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/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/responses/200/content/application\/json`. + case json([Components.Schemas.CopilotUsageMetricsDay]) + /// 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.CopilotUsageMetricsDay] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCopilotMetricsForOrganization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCopilotMetricsForOrganization.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotMetricsForOrganization.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.CopilotCopilotMetricsForOrganization.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/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/get(copilot/copilot-metrics-for-organization)/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/get(copilot/copilot-metrics-for-organization)/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 + ) + } + } + } + /// Copilot Usage Metrics API setting is disabled at the organization or enterprise level. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.UsageMetricsApiDisabled) + /// 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.UsageMetricsApiDisabled { + 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 Copilot organization usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the organization. + /// + /// The report contains aggregated metrics for the specified day, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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/organization-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)`. + public enum CopilotCopilotOrganizationOneDayUsageMetrics { + public static let id: Swift.String = "copilot/copilot-organization-one-day-usage-metrics" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/organization-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/organization-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.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/organization-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/organization-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.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/organization-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.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.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/organization-1-day/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/organization-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.CopilotCopilotOrganizationOneDayUsageMetrics.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCopilotOrganizationOneDayUsageMetrics.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotOrganizationOneDayUsageMetrics.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.CopilotCopilotOrganizationOneDayUsageMetrics.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/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)/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/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)/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/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)/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/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)/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/organization-1-day/get(copilot/copilot-organization-one-day-usage-metrics)/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 usage metrics + /// + /// Use this endpoint to retrieve download links for the latest 28-day organization Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the organization. + /// + /// The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. 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 range covered by the report. The report covers a complete 28-day period ending on the most recent 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/organization-28-day/latest`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-28-day/latest/get(copilot/copilot-organization-usage-metrics)`. + public enum CopilotCopilotOrganizationUsageMetrics { + public static let id: Swift.String = "copilot/copilot-organization-usage-metrics" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/organization-28-day/latest/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/organization-28-day/latest/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.CopilotCopilotOrganizationUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/organization-28-day/latest/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.CopilotCopilotOrganizationUsageMetrics.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.CopilotCopilotOrganizationUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotOrganizationUsageMetrics.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}/copilot/metrics/reports/organization-28-day/latest/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/organization-28-day/latest/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotUsageMetrics28DayReport) + /// 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.CopilotUsageMetrics28DayReport { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CopilotCopilotOrganizationUsageMetrics.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CopilotCopilotOrganizationUsageMetrics.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-28-day/latest/get(copilot/copilot-organization-usage-metrics)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.CopilotCopilotOrganizationUsageMetrics.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.CopilotCopilotOrganizationUsageMetrics.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/organization-28-day/latest/get(copilot/copilot-organization-usage-metrics)/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/organization-28-day/latest/get(copilot/copilot-organization-usage-metrics)/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/organization-28-day/latest/get(copilot/copilot-organization-usage-metrics)/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 users usage metrics for a specific day + /// + /// Use this endpoint to retrieve download links for the Copilot organization user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. + /// + /// The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. + /// + /// 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/users-1-day`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)`. + public enum CopilotCopilotOrganizationUsersOneDayUsageMetrics { + public static let id: Swift.String = "copilot/copilot-organization-users-one-day-usage-metrics" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-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/users-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.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-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/users-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.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-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.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Path, - headers: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Headers = .init(), - body: Operations.CopilotSetCopilotContentExclusionForOrganization.Input.Body + path: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Path, + query: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Input.Query, + headers: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.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/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-1-day/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/json/message`. - public var message: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - message: - public init(message: Swift.String? = nil) { - self.message = message - } - public enum CodingKeys: String, CodingKey { - case message - } - } - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/content_exclusion/PUT/responses/200/content/application\/json`. - case json(Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-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: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.CopilotUsageMetrics1DayReport { get throws { switch self { case let .json(body): @@ -8381,26 +10653,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body + public var body: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok.Body) { + public init(body: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Output.Ok.Body) { self.body = body } } - /// Success + /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotSetCopilotContentExclusionForOrganization.Output.Ok) + case ok(Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.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.CopilotSetCopilotContentExclusionForOrganization.Output.Ok { + public var ok: Operations.CopilotCopilotOrganizationUsersOneDayUsageMetrics.Output.Ok { get throws { switch self { case let .ok(response): @@ -8413,47 +10685,55 @@ public enum Operations { } } } - /// Internal Error + /// A header with no content is returned. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)/responses/204`. /// - /// HTTP response code: `500 internalServerError`. - case internalServerError(Components.Responses.InternalError) - /// The associated value of the enum case if `self` is `.internalServerError`. + /// HTTP response code: `204 noContent`. + case noContent(Components.Responses.NoContent) + /// A header with no content is returned. /// - /// - Throws: An error if `self` is not `.internalServerError`. - /// - SeeAlso: `.internalServerError`. - public var internalServerError: Components.Responses.InternalError { + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)/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 .internalServerError(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", + expectedStatus: "noContent", response: self ) } } } - /// Requires authentication + /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/401`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)/responses/500`. /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.RequiresAuthentication) - /// The associated value of the enum case if `self` is `.unauthorized`. + /// 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 `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.RequiresAuthentication { + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Components.Responses.InternalError { get throws { switch self { - case let .unauthorized(response): + case let .internalServerError(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "internalServerError", response: self ) } @@ -8461,7 +10741,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8484,7 +10764,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-1-day/get(copilot/copilot-organization-users-one-day-usage-metrics)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -8505,52 +10785,6 @@ public enum Operations { } } } - /// Payload Too Large - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/413`. - /// - /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Components.Responses.TooLarge) - /// The associated value of the enum case if `self` is `.contentTooLarge`. - /// - /// - Throws: An error if `self` is not `.contentTooLarge`. - /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Components.Responses.TooLarge { - get throws { - switch self { - case let .contentTooLarge(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "contentTooLarge", - response: self - ) - } - } - } - /// Validation failed, or the endpoint has been spammed. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.ValidationFailedSimple) - /// The associated value of the enum case if `self` is `.unprocessableContent`. - /// - /// - Throws: An error if `self` is not `.unprocessableContent`. - /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Components.Responses.ValidationFailedSimple { - get throws { - switch self { - case let .unprocessableContent(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unprocessableContent", - response: self - ) - } - } - } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. @@ -8582,32 +10816,28 @@ public enum Operations { } } } - /// Get Copilot metrics for an organization + /// Get Copilot organization users usage metrics /// - /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// Use this endpoint to retrieve download links for the latest 28-day organization users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the organization. /// - /// > [!NOTE] - /// > This endpoint will only return results for a given day if the organization contained **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement. /// - /// The response contains metrics for up to 100 days prior. Metrics are processed once per day for the previous day, - /// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics, - /// they must have telemetry enabled in their IDE. + /// 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 range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed. /// - /// To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization. - /// Only organization owners and owners and billing managers of the parent enterprise can view Copilot metrics. + /// 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. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes 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`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)`. - public enum CopilotCopilotMetricsForOrganization { - public static let id: Swift.String = "copilot/copilot-metrics-for-organization" + /// - Remark: HTTP `GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)`. + public enum CopilotCopilotOrganizationUsersUsageMetrics { + public static let id: Swift.String = "copilot/copilot-organization-users-usage-metrics" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/path`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-28-day/latest/GET/path`. public struct Path: Sendable, Hashable { /// The organization name. The name is not case sensitive. /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/path/org`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-28-day/latest/GET/path/org`. public var org: Components.Parameters.Org /// Creates a new `Path`. /// @@ -8617,84 +10847,43 @@ public enum Operations { self.org = org } } - public var path: Operations.CopilotCopilotMetricsForOrganization.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query`. - public struct Query: Sendable, Hashable { - /// Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/since`. - public var since: Swift.String? - /// Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/query/until`. - public var until: Swift.String? - /// 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}/copilot/metrics/GET/query/page`. - public var page: Components.Parameters.Page? - /// The number of days of metrics to display 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}/copilot/metrics/GET/query/per_page`. - public var perPage: Swift.Int? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - since: Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 100 days ago. - /// - until: Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. - /// - 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 days of metrics to display 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( - since: Swift.String? = nil, - until: Swift.String? = nil, - page: Components.Parameters.Page? = nil, - perPage: Swift.Int? = nil - ) { - self.since = since - self.until = until - self.page = page - self.perPage = perPage - } - } - public var query: Operations.CopilotCopilotMetricsForOrganization.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/header`. + public var path: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-28-day/latest/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.CopilotCopilotMetricsForOrganization.Input.Headers + public var headers: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.CopilotCopilotMetricsForOrganization.Input.Path, - query: Operations.CopilotCopilotMetricsForOrganization.Input.Query = .init(), - headers: Operations.CopilotCopilotMetricsForOrganization.Input.Headers = .init() + path: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Input.Path, + headers: Operations.CopilotCopilotOrganizationUsersUsageMetrics.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/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-28-day/latest/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/GET/responses/200/content/application\/json`. - case json([Components.Schemas.CopilotUsageMetricsDay]) + /// - Remark: Generated from `#/paths/orgs/{org}/copilot/metrics/reports/users-28-day/latest/GET/responses/200/content/application\/json`. + case json(Components.Schemas.CopilotUsageMetrics28DayReport) /// 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.CopilotUsageMetricsDay] { + public var json: Components.Schemas.CopilotUsageMetrics28DayReport { get throws { switch self { case let .json(body): @@ -8704,26 +10893,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CopilotCopilotMetricsForOrganization.Output.Ok.Body + public var body: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CopilotCopilotMetricsForOrganization.Output.Ok.Body) { + public init(body: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/200`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CopilotCopilotMetricsForOrganization.Output.Ok) + case ok(Operations.CopilotCopilotOrganizationUsersUsageMetrics.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.CopilotCopilotMetricsForOrganization.Output.Ok { + public var ok: Operations.CopilotCopilotOrganizationUsersUsageMetrics.Output.Ok { get throws { switch self { case let .ok(response): @@ -8738,7 +10927,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/500`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.InternalError) @@ -8761,7 +10950,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -8784,7 +10973,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/reports/users-28-day/latest/get(copilot/copilot-organization-users-usage-metrics)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -8805,29 +10994,6 @@ public enum Operations { } } } - /// Copilot Usage Metrics API setting is disabled at the organization or enterprise level. - /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/422`. - /// - /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Components.Responses.UsageMetricsApiDisabled) - /// 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.UsageMetricsApiDisabled { - 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. From dea04bff3205af21de5faa347c7e4ae4b3b4fc3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:59:45 +0000 Subject: [PATCH 20/27] Commit via running: make Sources/security-advisories --- Sources/security-advisories/Types.swift | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/Sources/security-advisories/Types.swift b/Sources/security-advisories/Types.swift index 59455adb58..b0390ab60c 100644 --- a/Sources/security-advisories/Types.swift +++ b/Sources/security-advisories/Types.swift @@ -1796,10 +1796,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -2047,7 +2043,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -2147,7 +2142,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -2247,7 +2241,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2348,7 +2341,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -3610,10 +3602,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/nullable-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/nullable-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/nullable-repository/archived`. @@ -3861,7 +3849,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -3961,7 +3948,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.NullableRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -4061,7 +4047,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4162,7 +4147,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility @@ -4381,8 +4365,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/full-repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? - /// - Remark: Generated from `#/components/schemas/full-repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// - Remark: Generated from `#/components/schemas/full-repository/archived`. public var archived: Swift.Bool /// Returns whether or not this repository disabled. @@ -4662,7 +4644,6 @@ public enum Components { /// - hasDiscussions: /// - hasPullRequests: /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: /// - archived: /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -4769,7 +4750,6 @@ public enum Components { hasDiscussions: Swift.Bool, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.FullRepository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -4876,7 +4856,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -4984,7 +4963,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From 35b714a56f28f77ac5e5d3b5fcf0573f69fb0a66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:02:39 +0000 Subject: [PATCH 21/27] Commit via running: make Sources/private-registries --- Sources/private-registries/Client.swift | 2 + Sources/private-registries/Types.swift | 418 +++++++++++++++++++++++- 2 files changed, 410 insertions(+), 10 deletions(-) diff --git a/Sources/private-registries/Client.swift b/Sources/private-registries/Client.swift index 828d00dea8..821440dc78 100644 --- a/Sources/private-registries/Client.swift +++ b/Sources/private-registries/Client.swift @@ -185,6 +185,7 @@ public struct Client: APIProtocol { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -492,6 +493,7 @@ public struct Client: APIProtocol { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// diff --git a/Sources/private-registries/Types.swift b/Sources/private-registries/Types.swift index 2d86bd09b8..d7b135d700 100644 --- a/Sources/private-registries/Types.swift +++ b/Sources/private-registries/Types.swift @@ -26,6 +26,7 @@ public protocol APIProtocol: Sendable { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -56,6 +57,7 @@ public protocol APIProtocol: Sendable { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -101,6 +103,7 @@ extension APIProtocol { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -157,6 +160,7 @@ extension APIProtocol { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -459,6 +463,20 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/registry_type`. public var registryType: Components.Schemas.OrgPrivateRegistryConfiguration.RegistryTypePayload + /// The authentication type for the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/auth_type`. + @frozen public enum AuthTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case token = "token" + case usernamePassword = "username_password" + case oidcAzure = "oidc_azure" + case oidcAws = "oidc_aws" + case oidcJfrog = "oidc_jfrog" + } + /// The authentication type for the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/auth_type`. + public var authType: Components.Schemas.OrgPrivateRegistryConfiguration.AuthTypePayload? /// The URL of the private registry. /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/url`. @@ -483,6 +501,46 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/visibility`. public var visibility: Components.Schemas.OrgPrivateRegistryConfiguration.VisibilityPayload + /// The tenant ID of the Azure AD application. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/tenant_id`. + public var tenantId: Swift.String? + /// The client ID of the Azure AD application. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/client_id`. + public var clientId: Swift.String? + /// The AWS region. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/aws_region`. + public var awsRegion: Swift.String? + /// The AWS account ID. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/account_id`. + public var accountId: Swift.String? + /// The AWS IAM role name. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/role_name`. + public var roleName: Swift.String? + /// The CodeArtifact domain. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/domain`. + public var domain: Swift.String? + /// The CodeArtifact domain owner. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/domain_owner`. + public var domainOwner: Swift.String? + /// The JFrog OIDC provider name. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/jfrog_oidc_provider_name`. + public var jfrogOidcProviderName: Swift.String? + /// The OIDC audience. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/audience`. + public var audience: Swift.String? + /// The JFrog identity mapping name. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/identity_mapping_name`. + public var identityMappingName: Swift.String? /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration/updated_at`. @@ -492,38 +550,82 @@ public enum Components { /// - Parameters: /// - name: The name of the private registry configuration. /// - registryType: The registry type. + /// - authType: The authentication type for the private registry. /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. /// - replacesBase: Whether this private registry replaces the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When `true`, Dependabot will only use this registry and will not fall back to the public registry. When `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. /// - visibility: Which type of organization repositories have access to the private registry. + /// - tenantId: The tenant ID of the Azure AD application. + /// - clientId: The client ID of the Azure AD application. + /// - awsRegion: The AWS region. + /// - accountId: The AWS account ID. + /// - roleName: The AWS IAM role name. + /// - domain: The CodeArtifact domain. + /// - domainOwner: The CodeArtifact domain owner. + /// - jfrogOidcProviderName: The JFrog OIDC provider name. + /// - audience: The OIDC audience. + /// - identityMappingName: The JFrog identity mapping name. /// - createdAt: /// - updatedAt: public init( name: Swift.String, registryType: Components.Schemas.OrgPrivateRegistryConfiguration.RegistryTypePayload, + authType: Components.Schemas.OrgPrivateRegistryConfiguration.AuthTypePayload? = nil, url: Swift.String? = nil, username: Swift.String? = nil, replacesBase: Swift.Bool? = nil, visibility: Components.Schemas.OrgPrivateRegistryConfiguration.VisibilityPayload, + tenantId: Swift.String? = nil, + clientId: Swift.String? = nil, + awsRegion: Swift.String? = nil, + accountId: Swift.String? = nil, + roleName: Swift.String? = nil, + domain: Swift.String? = nil, + domainOwner: Swift.String? = nil, + jfrogOidcProviderName: Swift.String? = nil, + audience: Swift.String? = nil, + identityMappingName: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date ) { self.name = name self.registryType = registryType + self.authType = authType self.url = url self.username = username self.replacesBase = replacesBase self.visibility = visibility + self.tenantId = tenantId + self.clientId = clientId + self.awsRegion = awsRegion + self.accountId = accountId + self.roleName = roleName + self.domain = domain + self.domainOwner = domainOwner + self.jfrogOidcProviderName = jfrogOidcProviderName + self.audience = audience + self.identityMappingName = identityMappingName self.createdAt = createdAt self.updatedAt = updatedAt } public enum CodingKeys: String, CodingKey { case name case registryType = "registry_type" + case authType = "auth_type" case url case username case replacesBase = "replaces_base" case visibility + case tenantId = "tenant_id" + case clientId = "client_id" + case awsRegion = "aws_region" + case accountId = "account_id" + case roleName = "role_name" + case domain + case domainOwner = "domain_owner" + case jfrogOidcProviderName = "jfrog_oidc_provider_name" + case audience + case identityMappingName = "identity_mapping_name" case createdAt = "created_at" case updatedAt = "updated_at" } @@ -560,6 +662,20 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/registry_type`. public var registryType: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.RegistryTypePayload + /// The authentication type for the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/auth_type`. + @frozen public enum AuthTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case token = "token" + case usernamePassword = "username_password" + case oidcAzure = "oidc_azure" + case oidcAws = "oidc_aws" + case oidcJfrog = "oidc_jfrog" + } + /// The authentication type for the private registry. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/auth_type`. + public var authType: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.AuthTypePayload? /// The URL of the private registry. /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/url`. @@ -588,6 +704,46 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/selected_repository_ids`. public var selectedRepositoryIds: [Swift.Int]? + /// The tenant ID of the Azure AD application. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/tenant_id`. + public var tenantId: Swift.String? + /// The client ID of the Azure AD application. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/client_id`. + public var clientId: Swift.String? + /// The AWS region. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/aws_region`. + public var awsRegion: Swift.String? + /// The AWS account ID. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/account_id`. + public var accountId: Swift.String? + /// The AWS IAM role name. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/role_name`. + public var roleName: Swift.String? + /// The CodeArtifact domain. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/domain`. + public var domain: Swift.String? + /// The CodeArtifact domain owner. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/domain_owner`. + public var domainOwner: Swift.String? + /// The JFrog OIDC provider name. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/jfrog_oidc_provider_name`. + public var jfrogOidcProviderName: Swift.String? + /// The OIDC audience. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/audience`. + public var audience: Swift.String? + /// The JFrog identity mapping name. + /// + /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/identity_mapping_name`. + public var identityMappingName: Swift.String? /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/created_at`. public var createdAt: Foundation.Date /// - Remark: Generated from `#/components/schemas/org-private-registry-configuration-with-selected-repositories/updated_at`. @@ -597,42 +753,86 @@ public enum Components { /// - Parameters: /// - name: The name of the private registry configuration. /// - registryType: The registry type. + /// - authType: The authentication type for the private registry. /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. /// - replacesBase: Whether this private registry replaces the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When `true`, Dependabot will only use this registry and will not fall back to the public registry. When `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. + /// - tenantId: The tenant ID of the Azure AD application. + /// - clientId: The client ID of the Azure AD application. + /// - awsRegion: The AWS region. + /// - accountId: The AWS account ID. + /// - roleName: The AWS IAM role name. + /// - domain: The CodeArtifact domain. + /// - domainOwner: The CodeArtifact domain owner. + /// - jfrogOidcProviderName: The JFrog OIDC provider name. + /// - audience: The OIDC audience. + /// - identityMappingName: The JFrog identity mapping name. /// - createdAt: /// - updatedAt: public init( name: Swift.String, registryType: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.RegistryTypePayload, + authType: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.AuthTypePayload? = nil, url: Swift.String? = nil, username: Swift.String? = nil, replacesBase: Swift.Bool? = nil, visibility: Components.Schemas.OrgPrivateRegistryConfigurationWithSelectedRepositories.VisibilityPayload, selectedRepositoryIds: [Swift.Int]? = nil, + tenantId: Swift.String? = nil, + clientId: Swift.String? = nil, + awsRegion: Swift.String? = nil, + accountId: Swift.String? = nil, + roleName: Swift.String? = nil, + domain: Swift.String? = nil, + domainOwner: Swift.String? = nil, + jfrogOidcProviderName: Swift.String? = nil, + audience: Swift.String? = nil, + identityMappingName: Swift.String? = nil, createdAt: Foundation.Date, updatedAt: Foundation.Date ) { self.name = name self.registryType = registryType + self.authType = authType self.url = url self.username = username self.replacesBase = replacesBase self.visibility = visibility self.selectedRepositoryIds = selectedRepositoryIds + self.tenantId = tenantId + self.clientId = clientId + self.awsRegion = awsRegion + self.accountId = accountId + self.roleName = roleName + self.domain = domain + self.domainOwner = domainOwner + self.jfrogOidcProviderName = jfrogOidcProviderName + self.audience = audience + self.identityMappingName = identityMappingName self.createdAt = createdAt self.updatedAt = updatedAt } public enum CodingKeys: String, CodingKey { case name case registryType = "registry_type" + case authType = "auth_type" case url case username case replacesBase = "replaces_base" case visibility case selectedRepositoryIds = "selected_repository_ids" + case tenantId = "tenant_id" + case clientId = "client_id" + case awsRegion = "aws_region" + case accountId = "account_id" + case roleName = "role_name" + case domain + case domainOwner = "domain_owner" + case jfrogOidcProviderName = "jfrog_oidc_provider_name" + case audience + case identityMappingName = "identity_mapping_name" case createdAt = "created_at" case updatedAt = "updated_at" } @@ -1040,6 +1240,7 @@ public enum Operations { /// /// /// Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -1115,14 +1316,14 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/replaces_base`. public var replacesBase: Swift.Bool? - /// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. + /// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. Required when `auth_type` is `token` or `username_password`. Should be omitted for OIDC auth types. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/encrypted_value`. - public var encryptedValue: Swift.String - /// The ID of the key you used to encrypt the secret. + public var encryptedValue: Swift.String? + /// The ID of the key you used to encrypt the secret. Required when `auth_type` is `token` or `username_password`. Should be omitted for OIDC auth types. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/key_id`. - public var keyId: Swift.String + public var keyId: Swift.String? /// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/visibility`. @@ -1139,6 +1340,60 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/selected_repository_ids`. public var selectedRepositoryIds: [Swift.Int]? + /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, or `oidc_jfrog` for OIDC authentication. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/auth_type`. + @frozen public enum AuthTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case token = "token" + case usernamePassword = "username_password" + case oidcAzure = "oidc_azure" + case oidcAws = "oidc_aws" + case oidcJfrog = "oidc_jfrog" + } + /// The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, or `oidc_jfrog` for OIDC authentication. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/auth_type`. + public var authType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.AuthTypePayload? + /// The tenant ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/tenant_id`. + public var tenantId: Swift.String? + /// The client ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/client_id`. + public var clientId: Swift.String? + /// The AWS region. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/aws_region`. + public var awsRegion: Swift.String? + /// The AWS account ID. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/account_id`. + public var accountId: Swift.String? + /// The AWS IAM role name. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/role_name`. + public var roleName: Swift.String? + /// The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/domain`. + public var domain: Swift.String? + /// The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/domain_owner`. + public var domainOwner: Swift.String? + /// The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/jfrog_oidc_provider_name`. + public var jfrogOidcProviderName: Swift.String? + /// The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/audience`. + public var audience: Swift.String? + /// The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/json/identity_mapping_name`. + public var identityMappingName: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -1146,19 +1401,41 @@ public enum Operations { /// - url: The URL of the private registry. /// - username: The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. /// - replacesBase: Whether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to `true`, Dependabot will only use this registry and will not fall back to the public registry. When set to `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. - /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. - /// - keyId: The ID of the key you used to encrypt the secret. + /// - encryptedValue: The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. Required when `auth_type` is `token` or `username_password`. Should be omitted for OIDC auth types. + /// - keyId: The ID of the key you used to encrypt the secret. Required when `auth_type` is `token` or `username_password`. Should be omitted for OIDC auth types. /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. + /// - authType: The authentication type for the private registry. Defaults to `token` if not specified. Use `oidc_azure`, `oidc_aws`, or `oidc_jfrog` for OIDC authentication. + /// - tenantId: The tenant ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// - clientId: The client ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// - awsRegion: The AWS region. Required when `auth_type` is `oidc_aws`. + /// - accountId: The AWS account ID. Required when `auth_type` is `oidc_aws`. + /// - roleName: The AWS IAM role name. Required when `auth_type` is `oidc_aws`. + /// - domain: The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. + /// - domainOwner: The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. + /// - jfrogOidcProviderName: The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. + /// - audience: The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// - identityMappingName: The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. public init( registryType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload, url: Swift.String, username: Swift.String? = nil, replacesBase: Swift.Bool? = nil, - encryptedValue: Swift.String, - keyId: Swift.String, + encryptedValue: Swift.String? = nil, + keyId: Swift.String? = nil, visibility: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.VisibilityPayload, - selectedRepositoryIds: [Swift.Int]? = nil + selectedRepositoryIds: [Swift.Int]? = nil, + authType: Operations.PrivateRegistriesCreateOrgPrivateRegistry.Input.Body.JsonPayload.AuthTypePayload? = nil, + tenantId: Swift.String? = nil, + clientId: Swift.String? = nil, + awsRegion: Swift.String? = nil, + accountId: Swift.String? = nil, + roleName: Swift.String? = nil, + domain: Swift.String? = nil, + domainOwner: Swift.String? = nil, + jfrogOidcProviderName: Swift.String? = nil, + audience: Swift.String? = nil, + identityMappingName: Swift.String? = nil ) { self.registryType = registryType self.url = url @@ -1168,6 +1445,17 @@ public enum Operations { self.keyId = keyId self.visibility = visibility self.selectedRepositoryIds = selectedRepositoryIds + self.authType = authType + self.tenantId = tenantId + self.clientId = clientId + self.awsRegion = awsRegion + self.accountId = accountId + self.roleName = roleName + self.domain = domain + self.domainOwner = domainOwner + self.jfrogOidcProviderName = jfrogOidcProviderName + self.audience = audience + self.identityMappingName = identityMappingName } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" @@ -1178,6 +1466,17 @@ public enum Operations { case keyId = "key_id" case visibility case selectedRepositoryIds = "selected_repository_ids" + case authType = "auth_type" + case tenantId = "tenant_id" + case clientId = "client_id" + case awsRegion = "aws_region" + case accountId = "account_id" + case roleName = "role_name" + case domain + case domainOwner = "domain_owner" + case jfrogOidcProviderName = "jfrog_oidc_provider_name" + case audience + case identityMappingName = "identity_mapping_name" } } /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/POST/requestBody/content/application\/json`. @@ -1704,6 +2003,7 @@ public enum Operations { /// /// /// Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." + /// For OIDC-based registries (`oidc_azure`, `oidc_aws`, or `oidc_jfrog`), the `encrypted_value` and `key_id` fields should be omitted. /// /// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. /// @@ -1812,6 +2112,60 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/selected_repository_ids`. public var selectedRepositoryIds: [Swift.Int]? + /// The authentication type for the private registry. This field cannot be changed after creation. If provided, it must match the existing `auth_type` of the configuration. To change the authentication type, delete and recreate the configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/auth_type`. + @frozen public enum AuthTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case token = "token" + case usernamePassword = "username_password" + case oidcAzure = "oidc_azure" + case oidcAws = "oidc_aws" + case oidcJfrog = "oidc_jfrog" + } + /// The authentication type for the private registry. This field cannot be changed after creation. If provided, it must match the existing `auth_type` of the configuration. To change the authentication type, delete and recreate the configuration. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/auth_type`. + public var authType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.AuthTypePayload? + /// The tenant ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/tenant_id`. + public var tenantId: Swift.String? + /// The client ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/client_id`. + public var clientId: Swift.String? + /// The AWS region. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/aws_region`. + public var awsRegion: Swift.String? + /// The AWS account ID. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/account_id`. + public var accountId: Swift.String? + /// The AWS IAM role name. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/role_name`. + public var roleName: Swift.String? + /// The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/domain`. + public var domain: Swift.String? + /// The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/domain_owner`. + public var domainOwner: Swift.String? + /// The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/jfrog_oidc_provider_name`. + public var jfrogOidcProviderName: Swift.String? + /// The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/audience`. + public var audience: Swift.String? + /// The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/json/identity_mapping_name`. + public var identityMappingName: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -1823,6 +2177,17 @@ public enum Operations { /// - keyId: The ID of the key you used to encrypt the secret. /// - visibility: Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. /// - selectedRepositoryIds: An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. + /// - authType: The authentication type for the private registry. This field cannot be changed after creation. If provided, it must match the existing `auth_type` of the configuration. To change the authentication type, delete and recreate the configuration. + /// - tenantId: The tenant ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// - clientId: The client ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. + /// - awsRegion: The AWS region. Required when `auth_type` is `oidc_aws`. + /// - accountId: The AWS account ID. Required when `auth_type` is `oidc_aws`. + /// - roleName: The AWS IAM role name. Required when `auth_type` is `oidc_aws`. + /// - domain: The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. + /// - domainOwner: The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. + /// - jfrogOidcProviderName: The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. + /// - audience: The OIDC audience. Optional for `oidc_aws` and `oidc_jfrog` auth types. + /// - identityMappingName: The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. public init( registryType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.RegistryTypePayload? = nil, url: Swift.String? = nil, @@ -1831,7 +2196,18 @@ public enum Operations { encryptedValue: Swift.String? = nil, keyId: Swift.String? = nil, visibility: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.VisibilityPayload? = nil, - selectedRepositoryIds: [Swift.Int]? = nil + selectedRepositoryIds: [Swift.Int]? = nil, + authType: Operations.PrivateRegistriesUpdateOrgPrivateRegistry.Input.Body.JsonPayload.AuthTypePayload? = nil, + tenantId: Swift.String? = nil, + clientId: Swift.String? = nil, + awsRegion: Swift.String? = nil, + accountId: Swift.String? = nil, + roleName: Swift.String? = nil, + domain: Swift.String? = nil, + domainOwner: Swift.String? = nil, + jfrogOidcProviderName: Swift.String? = nil, + audience: Swift.String? = nil, + identityMappingName: Swift.String? = nil ) { self.registryType = registryType self.url = url @@ -1841,6 +2217,17 @@ public enum Operations { self.keyId = keyId self.visibility = visibility self.selectedRepositoryIds = selectedRepositoryIds + self.authType = authType + self.tenantId = tenantId + self.clientId = clientId + self.awsRegion = awsRegion + self.accountId = accountId + self.roleName = roleName + self.domain = domain + self.domainOwner = domainOwner + self.jfrogOidcProviderName = jfrogOidcProviderName + self.audience = audience + self.identityMappingName = identityMappingName } public enum CodingKeys: String, CodingKey { case registryType = "registry_type" @@ -1851,6 +2238,17 @@ public enum Operations { case keyId = "key_id" case visibility case selectedRepositoryIds = "selected_repository_ids" + case authType = "auth_type" + case tenantId = "tenant_id" + case clientId = "client_id" + case awsRegion = "aws_region" + case accountId = "account_id" + case roleName = "role_name" + case domain + case domainOwner = "domain_owner" + case jfrogOidcProviderName = "jfrog_oidc_provider_name" + case audience + case identityMappingName = "identity_mapping_name" } } /// - Remark: Generated from `#/paths/orgs/{org}/private-registries/{secret_name}/PATCH/requestBody/content/application\/json`. From 1b7f8c66b500b9ef2dddde26e8cddff5c8d00969 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:03:02 +0000 Subject: [PATCH 22/27] Commit via running: make Sources/hosted-compute --- Sources/hosted-compute/Types.swift | 36 ++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/Sources/hosted-compute/Types.swift b/Sources/hosted-compute/Types.swift index 4707941ecf..d82f63110d 100644 --- a/Sources/hosted-compute/Types.swift +++ b/Sources/hosted-compute/Types.swift @@ -627,25 +627,41 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/network_settings_ids`. public var networkSettingsIds: [Swift.String] + /// A list of identifiers of the failover network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/failover_network_settings_ids`. + public var failoverNetworkSettingsIds: [Swift.String]? + /// Indicates whether the failover network resource is enabled. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/json/failover_network_enabled`. + public var failoverNetworkEnabled: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - name: Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. /// - computeService: The hosted compute service to use for the network configuration. /// - networkSettingsIds: A list of identifiers of the network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. + /// - failoverNetworkSettingsIds: A list of identifiers of the failover network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. + /// - failoverNetworkEnabled: Indicates whether the failover network resource is enabled. public init( name: Swift.String, computeService: Operations.HostedComputeCreateNetworkConfigurationForOrg.Input.Body.JsonPayload.ComputeServicePayload? = nil, - networkSettingsIds: [Swift.String] + networkSettingsIds: [Swift.String], + failoverNetworkSettingsIds: [Swift.String]? = nil, + failoverNetworkEnabled: Swift.Bool? = nil ) { self.name = name self.computeService = computeService self.networkSettingsIds = networkSettingsIds + self.failoverNetworkSettingsIds = failoverNetworkSettingsIds + self.failoverNetworkEnabled = failoverNetworkEnabled } public enum CodingKeys: String, CodingKey { case name case computeService = "compute_service" case networkSettingsIds = "network_settings_ids" + case failoverNetworkSettingsIds = "failover_network_settings_ids" + case failoverNetworkEnabled = "failover_network_enabled" } } /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/POST/requestBody/content/application\/json`. @@ -983,25 +999,41 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/network_settings_ids`. public var networkSettingsIds: [Swift.String]? + /// A list of identifiers of the failover network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/failover_network_settings_ids`. + public var failoverNetworkSettingsIds: [Swift.String]? + /// Indicates whether the failover network resource is enabled. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/json/failover_network_enabled`. + public var failoverNetworkEnabled: Swift.Bool? /// Creates a new `JsonPayload`. /// /// - Parameters: /// - name: Name of the network configuration. Must be between 1 and 100 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'. /// - computeService: The hosted compute service to use for the network configuration. /// - networkSettingsIds: A list of identifiers of the network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. + /// - failoverNetworkSettingsIds: A list of identifiers of the failover network settings resources to use for the network configuration. Exactly one resource identifier must be specified in the list. + /// - failoverNetworkEnabled: Indicates whether the failover network resource is enabled. public init( name: Swift.String? = nil, computeService: Operations.HostedComputeUpdateNetworkConfigurationForOrg.Input.Body.JsonPayload.ComputeServicePayload? = nil, - networkSettingsIds: [Swift.String]? = nil + networkSettingsIds: [Swift.String]? = nil, + failoverNetworkSettingsIds: [Swift.String]? = nil, + failoverNetworkEnabled: Swift.Bool? = nil ) { self.name = name self.computeService = computeService self.networkSettingsIds = networkSettingsIds + self.failoverNetworkSettingsIds = failoverNetworkSettingsIds + self.failoverNetworkEnabled = failoverNetworkEnabled } public enum CodingKeys: String, CodingKey { case name case computeService = "compute_service" case networkSettingsIds = "network_settings_ids" + case failoverNetworkSettingsIds = "failover_network_settings_ids" + case failoverNetworkEnabled = "failover_network_enabled" } } /// - Remark: Generated from `#/paths/orgs/{org}/settings/network-configurations/{network_configuration_id}/PATCH/requestBody/content/application\/json`. From ea9f7bf4ed8f3bbb14d2ff9145069bc123ed8b76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:03:24 +0000 Subject: [PATCH 23/27] Commit via running: make Sources/credentials --- Sources/credentials/Client.swift | 8 ++++++-- Sources/credentials/Types.swift | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Sources/credentials/Client.swift b/Sources/credentials/Client.swift index 5b24d4971c..66fee66623 100644 --- a/Sources/credentials/Client.swift +++ b/Sources/credentials/Client.swift @@ -43,8 +43,12 @@ public struct Client: APIProtocol { /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. /// /// This endpoint currently accepts the following credential types: - /// - Personal access tokens (classic) - /// - Fine-grained personal access tokens + /// - Personal access tokens (classic) (`ghp_`) + /// - Fine-grained personal access tokens (`github_pat_`) + /// - OAuth app access tokens (`gho_`) + /// - User-to-server tokens from GitHub Apps (`ghu_`) + /// - Refresh tokens from GitHub Apps (`ghr_`) + /// /// /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. diff --git a/Sources/credentials/Types.swift b/Sources/credentials/Types.swift index d4cad8dd0b..47be1d1291 100644 --- a/Sources/credentials/Types.swift +++ b/Sources/credentials/Types.swift @@ -16,8 +16,12 @@ public protocol APIProtocol: Sendable { /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. /// /// This endpoint currently accepts the following credential types: - /// - Personal access tokens (classic) - /// - Fine-grained personal access tokens + /// - Personal access tokens (classic) (`ghp_`) + /// - Fine-grained personal access tokens (`github_pat_`) + /// - OAuth app access tokens (`gho_`) + /// - User-to-server tokens from GitHub Apps (`ghu_`) + /// - Refresh tokens from GitHub Apps (`ghr_`) + /// /// /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. @@ -39,8 +43,12 @@ extension APIProtocol { /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. /// /// This endpoint currently accepts the following credential types: - /// - Personal access tokens (classic) - /// - Fine-grained personal access tokens + /// - Personal access tokens (classic) (`ghp_`) + /// - Fine-grained personal access tokens (`github_pat_`) + /// - OAuth app access tokens (`gho_`) + /// - User-to-server tokens from GitHub Apps (`ghu_`) + /// - Refresh tokens from GitHub Apps (`ghr_`) + /// /// /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. @@ -257,8 +265,12 @@ public enum Operations { /// Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation. /// /// This endpoint currently accepts the following credential types: - /// - Personal access tokens (classic) - /// - Fine-grained personal access tokens + /// - Personal access tokens (classic) (`ghp_`) + /// - Fine-grained personal access tokens (`github_pat_`) + /// - OAuth app access tokens (`gho_`) + /// - User-to-server tokens from GitHub Apps (`ghu_`) + /// - Refresh tokens from GitHub Apps (`ghr_`) + /// /// /// Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. /// GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated. From 4aa135e6a95aaeb9fc66d3db60384ff7c0c5a2d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:04:08 +0000 Subject: [PATCH 24/27] Commit via running: make Sources/projects --- Sources/projects/Types.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Sources/projects/Types.swift b/Sources/projects/Types.swift index 137c9079d6..e971e91b7b 100644 --- a/Sources/projects/Types.swift +++ b/Sources/projects/Types.swift @@ -1459,10 +1459,6 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/repository/pull_request_creation_policy`. public var pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? - /// Whether commit comments are enabled. - /// - /// - Remark: Generated from `#/components/schemas/repository/has_commit_comments`. - public var hasCommitComments: Swift.Bool? /// Whether the repository is archived. /// /// - Remark: Generated from `#/components/schemas/repository/archived`. @@ -1710,7 +1706,6 @@ public enum Components { /// - hasDiscussions: Whether discussions are enabled. /// - hasPullRequests: Whether pull requests are enabled. /// - pullRequestCreationPolicy: The policy controlling who can create pull requests: all or collaborators_only. - /// - hasCommitComments: Whether commit comments are enabled. /// - archived: Whether the repository is archived. /// - disabled: Returns whether or not this repository disabled. /// - visibility: The repository visibility: public, private, or internal. @@ -1810,7 +1805,6 @@ public enum Components { hasDiscussions: Swift.Bool? = nil, hasPullRequests: Swift.Bool? = nil, pullRequestCreationPolicy: Components.Schemas.Repository.PullRequestCreationPolicyPayload? = nil, - hasCommitComments: Swift.Bool? = nil, archived: Swift.Bool, disabled: Swift.Bool, visibility: Swift.String? = nil, @@ -1910,7 +1904,6 @@ public enum Components { self.hasDiscussions = hasDiscussions self.hasPullRequests = hasPullRequests self.pullRequestCreationPolicy = pullRequestCreationPolicy - self.hasCommitComments = hasCommitComments self.archived = archived self.disabled = disabled self.visibility = visibility @@ -2011,7 +2004,6 @@ public enum Components { case hasDiscussions = "has_discussions" case hasPullRequests = "has_pull_requests" case pullRequestCreationPolicy = "pull_request_creation_policy" - case hasCommitComments = "has_commit_comments" case archived case disabled case visibility From a56db61794741d54f87f1353d49eb18d2f34f697 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:04:31 +0000 Subject: [PATCH 25/27] Commit via running: make Sources/agent-tasks --- Sources/agent-tasks/Client.swift | 1019 +++++ Sources/agent-tasks/Types.swift | 7204 ++++++++++++++++++++++++++++++ 2 files changed, 8223 insertions(+) create mode 100644 Sources/agent-tasks/Client.swift create mode 100644 Sources/agent-tasks/Types.swift diff --git a/Sources/agent-tasks/Client.swift b/Sources/agent-tasks/Client.swift new file mode 100644 index 0000000000..c65a16152b --- /dev/null +++ b/Sources/agent-tasks/Client.swift @@ -0,0 +1,1019 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +import HTTPTypes +/// GitHub's v3 REST API. +public struct Client: APIProtocol { + /// The underlying HTTP client. + private let client: UniversalClient + /// Creates a new client. + /// - Parameters: + /// - serverURL: The server URL that the client connects to. Any server + /// URLs defined in the OpenAPI document are available as static methods + /// on the ``Servers`` type. + /// - configuration: A set of configuration values for the client. + /// - transport: A transport that performs HTTP operations. + /// - middlewares: A list of middlewares to call before the transport. + public init( + serverURL: Foundation.URL, + configuration: Configuration = .init(), + transport: any ClientTransport, + middlewares: [any ClientMiddleware] = [] + ) { + self.client = .init( + serverURL: serverURL, + configuration: configuration, + transport: transport, + middlewares: middlewares + ) + } + private var converter: Converter { + client.converter + } + /// List tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + public func agentTasksListTasksForRepo(_ input: Operations.AgentTasksListTasksForRepo.Input) async throws -> Operations.AgentTasksListTasksForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksListTasksForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/repos/{}/{}/tasks", + 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: "per_page", + value: input.query.perPage + ) + 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: "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: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_archived", + value: input.query.isArchived + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "creator_id", + value: input.query.creatorId + ) + 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.AgentTasksListTasksForRepo.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.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.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasksForRepo.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 + ) + ) + } + } + ) + } + /// Create a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Creates a new task for a repository + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)`. + public func agentTasksCreateTask(_ input: Operations.AgentTasksCreateTask.Input) async throws -> Operations.AgentTasksCreateTask.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksCreateTask.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/repos/{}/{}/tasks", + 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.AgentTasksCreateTask.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTask.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: Operations.AgentTasksCreateTask.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTask.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksCreateTask.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTask.Output.Unauthorized.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksCreateTask.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksCreateTask.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 task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + public func agentTasksGetTaskByRepoAndId(_ input: Operations.AgentTasksGetTaskByRepoAndId.Input) async throws -> Operations.AgentTasksGetTaskByRepoAndId.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksGetTaskByRepoAndId.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/repos/{}/{}/tasks/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.taskId + ] + ) + 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.AgentTasksGetTaskByRepoAndId.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.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: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.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.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskByRepoAndId.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 + ) + ) + } + } + ) + } + /// List tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + public func agentTasksListTasks(_ input: Operations.AgentTasksListTasks.Input) async throws -> Operations.AgentTasksListTasks.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksListTasks.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/tasks", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.perPage + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + 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: "state", + value: input.query.state + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "is_archived", + value: input.query.isArchived + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + 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.AgentTasksListTasks.Output.Ok.Headers = .init(link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Swift.String.self + )) + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init( + headers: headers, + body: body + )) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksListTasks.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 task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + public func agentTasksGetTaskById(_ input: Operations.AgentTasksGetTaskById.Input) async throws -> Operations.AgentTasksGetTaskById.Output { + try await client.send( + input: input, + forOperation: Operations.AgentTasksGetTaskById.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/agents/tasks/{}", + parameters: [ + input.path.taskId + ] + ) + 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.AgentTasksGetTaskById.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.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: Operations.AgentTasksGetTaskById.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskById.Output.Forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.AgentTasksGetTaskById.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.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.AgentTasksGetTaskById.Output.UnprocessableContent.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.AgentTasksGetTaskById.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 + ) + ) + } + } + ) + } +} diff --git a/Sources/agent-tasks/Types.swift b/Sources/agent-tasks/Types.swift new file mode 100644 index 0000000000..fabec465c5 --- /dev/null +++ b/Sources/agent-tasks/Types.swift @@ -0,0 +1,7204 @@ +// Generated by swift-openapi-generator, do not modify. +@_spi(Generated) import OpenAPIRuntime +#if os(Linux) +@preconcurrency import struct Foundation.URL +@preconcurrency import struct Foundation.Data +@preconcurrency import struct Foundation.Date +#else +import struct Foundation.URL +import struct Foundation.Data +import struct Foundation.Date +#endif +/// A type that performs HTTP operations defined by the OpenAPI document. +public protocol APIProtocol: Sendable { + /// List tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + func agentTasksListTasksForRepo(_ input: Operations.AgentTasksListTasksForRepo.Input) async throws -> Operations.AgentTasksListTasksForRepo.Output + /// Create a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Creates a new task for a repository + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)`. + func agentTasksCreateTask(_ input: Operations.AgentTasksCreateTask.Input) async throws -> Operations.AgentTasksCreateTask.Output + /// Get a task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + func agentTasksGetTaskByRepoAndId(_ input: Operations.AgentTasksGetTaskByRepoAndId.Input) async throws -> Operations.AgentTasksGetTaskByRepoAndId.Output + /// List tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + func agentTasksListTasks(_ input: Operations.AgentTasksListTasks.Input) async throws -> Operations.AgentTasksListTasks.Output + /// Get a task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + func agentTasksGetTaskById(_ input: Operations.AgentTasksGetTaskById.Input) async throws -> Operations.AgentTasksGetTaskById.Output +} + +/// Convenience overloads for operation inputs. +extension APIProtocol { + /// List tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + public func agentTasksListTasksForRepo( + path: Operations.AgentTasksListTasksForRepo.Input.Path, + query: Operations.AgentTasksListTasksForRepo.Input.Query = .init(), + headers: Operations.AgentTasksListTasksForRepo.Input.Headers = .init() + ) async throws -> Operations.AgentTasksListTasksForRepo.Output { + try await agentTasksListTasksForRepo(Operations.AgentTasksListTasksForRepo.Input( + path: path, + query: query, + headers: headers + )) + } + /// Create a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Creates a new task for a repository + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)`. + public func agentTasksCreateTask( + path: Operations.AgentTasksCreateTask.Input.Path, + headers: Operations.AgentTasksCreateTask.Input.Headers = .init(), + body: Operations.AgentTasksCreateTask.Input.Body + ) async throws -> Operations.AgentTasksCreateTask.Output { + try await agentTasksCreateTask(Operations.AgentTasksCreateTask.Input( + path: path, + headers: headers, + body: body + )) + } + /// Get a task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + public func agentTasksGetTaskByRepoAndId( + path: Operations.AgentTasksGetTaskByRepoAndId.Input.Path, + headers: Operations.AgentTasksGetTaskByRepoAndId.Input.Headers = .init() + ) async throws -> Operations.AgentTasksGetTaskByRepoAndId.Output { + try await agentTasksGetTaskByRepoAndId(Operations.AgentTasksGetTaskByRepoAndId.Input( + path: path, + headers: headers + )) + } + /// List tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + public func agentTasksListTasks( + query: Operations.AgentTasksListTasks.Input.Query = .init(), + headers: Operations.AgentTasksListTasks.Input.Headers = .init() + ) async throws -> Operations.AgentTasksListTasks.Output { + try await agentTasksListTasks(Operations.AgentTasksListTasks.Input( + query: query, + headers: headers + )) + } + /// Get a task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + public func agentTasksGetTaskById( + path: Operations.AgentTasksGetTaskById.Input.Path, + headers: Operations.AgentTasksGetTaskById.Input.Headers = .init() + ) async throws -> Operations.AgentTasksGetTaskById.Output { + try await agentTasksGetTaskById(Operations.AgentTasksGetTaskById.Input( + path: path, + headers: headers + )) + } +} + +/// Server URLs defined in the OpenAPI document. +public enum Servers { + public enum Server1 { + public static func url() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.github.com", + variables: [] + ) + } + } + @available(*, deprecated, renamed: "Servers.Server1.url") + public static func server1() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.github.com", + variables: [] + ) + } +} + +/// Types generated from the components section of the OpenAPI document. +public enum Components { + /// Types generated from the `#/components/schemas` section of the OpenAPI document. + public enum Schemas {} + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters {} + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses {} + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers {} +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List tasks for repository + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for a specific repository + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)`. + public enum AgentTasksListTasksForRepo { + public static let id: Swift.String = "agent-tasks/list-tasks-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/path/owner`. + public var owner: Swift.String + /// The name of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/path/repo`. + public var repo: 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. The name is not case sensitive. + public init( + owner: Swift.String, + repo: Swift.String + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.AgentTasksListTasksForRepo.Input.Path + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/per_page`. + public var perPage: Swift.Int? + /// The page number of the results to fetch. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/page`. + public var page: Swift.Int? + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/sort`. + @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case updatedAt = "updated_at" + case createdAt = "created_at" + } + /// The field to sort results by. Can be `updated_at` or `created_at`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/sort`. + public var sort: Operations.AgentTasksListTasksForRepo.Input.Query.SortPayload? + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/direction`. + @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort results. Can be `asc` or `desc`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/direction`. + public var direction: Operations.AgentTasksListTasksForRepo.Input.Query.DirectionPayload? + /// Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/state`. + public var state: Swift.String? + /// Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/is_archived`. + public var isArchived: Swift.Bool? + /// Only show tasks updated at or after this time (ISO 8601 timestamp) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/since`. + public var since: Foundation.Date? + /// Filter tasks by creator user ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/query/creator_id`. + public var creatorId: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). + /// - page: The page number of the results to fetch. + /// - sort: The field to sort results by. Can be `updated_at` or `created_at`. + /// - direction: The direction to sort results. Can be `asc` or `desc`. + /// - state: Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// - isArchived: Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// - since: Only show tasks updated at or after this time (ISO 8601 timestamp) + /// - creatorId: Filter tasks by creator user ID + public init( + perPage: Swift.Int? = nil, + page: Swift.Int? = nil, + sort: Operations.AgentTasksListTasksForRepo.Input.Query.SortPayload? = nil, + direction: Operations.AgentTasksListTasksForRepo.Input.Query.DirectionPayload? = nil, + state: Swift.String? = nil, + isArchived: Swift.Bool? = nil, + since: Foundation.Date? = nil, + creatorId: Swift.Int? = nil + ) { + self.perPage = perPage + self.page = page + self.sort = sort + self.direction = direction + self.state = state + self.isArchived = isArchived + self.since = since + self.creatorId = creatorId + } + } + public var query: Operations.AgentTasksListTasksForRepo.Input.Query + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/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.AgentTasksListTasksForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.AgentTasksListTasksForRepo.Input.Path, + query: Operations.AgentTasksListTasksForRepo.Input.Query = .init(), + headers: Operations.AgentTasksListTasksForRepo.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/agents/repos/{owner}/{repo}/tasks/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// Pagination links. Contains rel="first" (always), + /// rel="prev" (when current page > 1), + /// rel="next" (when more pages exist), and rel="last" (when on the final page). + /// + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/headers/Link`. + public var link: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: Pagination links. Contains rel="first" (always), + public init(link: Swift.String? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.AgentTasksListTasksForRepo.Output.Ok.Headers + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload`. + public struct TasksPayloadPayload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + case case1(Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload.Case1Payload) + 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) + } + 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) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator`. + public var creator: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + public var creatorType: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public var owner: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public var repository: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/state`. + public var state: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case githubResource = "github_resource" + case branch = "branch" + } + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64? + /// Resource type (e.g., pull_request, issue) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/type`. + public var _type: Swift.String? + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - _type: Resource type (e.g., pull_request, issue) + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64? = nil, + _type: Swift.String? = nil, + globalId: Swift.String? = nil + ) { + self.id = id + self._type = _type + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + 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 .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 value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + public var data: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Discriminator for data shape + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public var artifacts: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/TasksPayload/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `TasksPayloadPayload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - 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 + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? = nil, + state: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/tasks`. + public typealias TasksPayload = [Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayloadPayload] + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/tasks`. + public var tasks: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayload + /// Total count of active (non-archived) tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/total_active_count`. + public var totalActiveCount: Swift.Int32? + /// Total count of archived tasks + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/json/total_archived_count`. + public var totalArchivedCount: Swift.Int32? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - tasks: List of tasks + /// - totalActiveCount: Total count of active (non-archived) tasks + /// - totalArchivedCount: Total count of archived tasks + public init( + tasks: Operations.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload.TasksPayload, + totalActiveCount: Swift.Int32? = nil, + totalArchivedCount: Swift.Int32? = nil + ) { + self.tasks = tasks + self.totalActiveCount = totalActiveCount + self.totalArchivedCount = totalArchivedCount + } + public enum CodingKeys: String, CodingKey { + case tasks + case totalActiveCount = "total_active_count" + case totalArchivedCount = "total_archived_count" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentTasksListTasksForRepo.Output.Ok.Headers = .init(), + body: Operations.AgentTasksListTasksForRepo.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Tasks retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.Output.BadRequest.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.AgentTasksListTasksForRepo.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad request + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.Output.Unauthorized.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.AgentTasksListTasksForRepo.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksListTasksForRepo.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksListTasksForRepo.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.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/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/404/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.Output.NotFound.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.AgentTasksListTasksForRepo.Output.NotFound.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.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/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasksForRepo.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/get(agent-tasks/list-tasks-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksListTasksForRepo.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.AgentTasksListTasksForRepo.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 + ] + } + } + } + /// Create a task + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Creates a new task for a repository + /// + /// + /// - Remark: HTTP `POST /agents/repos/{owner}/{repo}/tasks`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)`. + public enum AgentTasksCreateTask { + public static let id: Swift.String = "agent-tasks/create-task" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/path/owner`. + public var owner: Swift.String + /// The name of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/path/repo`. + public var repo: 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. The name is not case sensitive. + public init( + owner: Swift.String, + repo: Swift.String + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.AgentTasksCreateTask.Input.Path + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/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.AgentTasksCreateTask.Input.Headers + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Agent ID (optional, defaults to coding agent) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/agent_id`. + public var agentId: Swift.Int64? + /// Additional prompting for the agent + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/problem_statement`. + public var problemStatement: Swift.String? + /// User's written prompt + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/event_content`. + public var eventContent: Swift.String + /// 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` + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/model`. + public var model: Swift.String? + /// Custom agent identifier + /// + /// - 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`. + public var createPullRequest: Swift.Bool? + /// Base ref for new branch/PR + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/json/base_ref`. + public var baseRef: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - agentId: Agent ID (optional, defaults to coding agent) + /// - problemStatement: Additional prompting for the agent + /// - eventContent: User's written prompt + /// - 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: Custom agent identifier + /// - createPullRequest: Whether to create a PR + /// - baseRef: Base ref for new branch/PR + public init( + agentId: Swift.Int64? = nil, + problemStatement: Swift.String? = nil, + eventContent: Swift.String, + model: Swift.String? = nil, + customAgent: Swift.String? = nil, + createPullRequest: Swift.Bool? = nil, + baseRef: Swift.String? = nil + ) { + self.agentId = agentId + self.problemStatement = problemStatement + self.eventContent = eventContent + self.model = model + self.customAgent = customAgent + self.createPullRequest = createPullRequest + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case agentId = "agent_id" + case problemStatement = "problem_statement" + case eventContent = "event_content" + case model + case customAgent = "custom_agent" + case createPullRequest = "create_pull_request" + case baseRef = "base_ref" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/requestBody/content/application\/json`. + case json(Operations.AgentTasksCreateTask.Input.Body.JsonPayload) + } + public var body: Operations.AgentTasksCreateTask.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.AgentTasksCreateTask.Input.Path, + headers: Operations.AgentTasksCreateTask.Input.Headers = .init(), + body: Operations.AgentTasksCreateTask.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/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator/case1`. + case case1(Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.CreatorPayload.Case1Payload) + 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) + } + 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) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator`. + public var creator: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/creator_type`. + public var creatorType: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/owner`. + public var owner: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/repository`. + public var repository: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/state`. + public var state: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.ProviderPayload + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case githubResource = "github_resource" + case branch = "branch" + } + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64? + /// Resource type (e.g., pull_request, issue) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1/type`. + public var _type: Swift.String? + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - _type: Resource type (e.g., pull_request, issue) + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64? = nil, + _type: Swift.String? = nil, + globalId: Swift.String? = nil + ) { + self.id = id + self._type = _type + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + 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 .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 value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/ArtifactsPayload/data`. + public var data: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Discriminator for data shape + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/artifacts`. + public var artifacts: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/json/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - 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 + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.RepositoryPayload? = nil, + state: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksCreateTask.Output.Created.Body.JsonPayload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/201/content/application\/json`. + case json(Operations.AgentTasksCreateTask.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.AgentTasksCreateTask.Output.Created.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTask.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTask.Output.Created.Body) { + self.body = body + } + } + /// Task created successfully + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.AgentTasksCreateTask.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.AgentTasksCreateTask.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTask.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTask.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTask.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksCreateTask.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTask.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/400/content/application\/json`. + case json(Operations.AgentTasksCreateTask.Output.BadRequest.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.AgentTasksCreateTask.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTask.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTask.Output.BadRequest.Body) { + self.body = body + } + } + /// Problems parsing JSON + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksCreateTask.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.AgentTasksCreateTask.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTask.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTask.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTask.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksCreateTask.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTask.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/401/content/application\/json`. + case json(Operations.AgentTasksCreateTask.Output.Unauthorized.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.AgentTasksCreateTask.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTask.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTask.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksCreateTask.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksCreateTask.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/403/content/application\/json`. + case json(Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.AgentTasksCreateTask.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTask.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTask.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksCreateTask.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.AgentTasksCreateTask.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/POST/responses/422/content/application\/json`. + case json(Operations.AgentTasksCreateTask.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.AgentTasksCreateTask.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksCreateTask.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/post(agent-tasks/create-task)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksCreateTask.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.AgentTasksCreateTask.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 task by repo + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID scoped to an owner/repo path + /// + /// + /// - Remark: HTTP `GET /agents/repos/{owner}/{repo}/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)`. + public enum AgentTasksGetTaskByRepoAndId { + public static let id: Swift.String = "agent-tasks/get-task-by-repo-and-id" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path/owner`. + public var owner: Swift.String + /// The name of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path/repo`. + public var repo: Swift.String + /// The unique identifier of the task. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/path/task_id`. + public var taskId: 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. The name is not case sensitive. + /// - taskId: The unique identifier of the task. + public init( + owner: Swift.String, + repo: Swift.String, + taskId: Swift.String + ) { + self.owner = owner + self.repo = repo + self.taskId = taskId + } + } + public var path: Operations.AgentTasksGetTaskByRepoAndId.Input.Path + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_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.AgentTasksGetTaskByRepoAndId.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentTasksGetTaskByRepoAndId.Input.Path, + headers: Operations.AgentTasksGetTaskByRepoAndId.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + case case1(Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload.Case1Payload) + 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) + } + 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) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + public var creator: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + public var creatorType: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public var owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public var repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + public var state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case githubResource = "github_resource" + case branch = "branch" + } + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64? + /// Resource type (e.g., pull_request, issue) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/type`. + public var _type: Swift.String? + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - _type: Resource type (e.g., pull_request, issue) + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64? = nil, + _type: Swift.String? = nil, + globalId: Swift.String? = nil + ) { + self.id = id + self._type = _type + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + 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 .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 value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + public var data: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Discriminator for data shape + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public var artifacts: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `Value1Payload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - 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 + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? = nil, + state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value1`. + public var value1: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Full session details within a task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload`. + public struct SessionsPayloadPayload: Codable, Hashable, Sendable { + /// Session ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/id`. + public var id: Swift.String + /// Session name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/name`. + public var name: Swift.String? + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public struct UserPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user/id`. + public var id: Swift.Int64? + /// Creates a new `UserPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public var user: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public var owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public var repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? + /// Agent ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/agent_id`. + public var agentId: Swift.Int64? + /// Agent internal task ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/agent_task_id`. + public var agentTaskId: Swift.String? + /// Task ID this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/task_id`. + public var taskId: Swift.String? + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + public var state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload + /// Creation timestamp + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/created_at`. + public var createdAt: Foundation.Date + /// Last update timestamp + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Completion timestamp + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/completed_at`. + public var completedAt: Foundation.Date? + /// Type of event that triggered this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_type`. + public var eventType: Swift.String? + /// URL of the triggering event + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_url`. + public var eventUrl: Swift.String? + /// Content of the triggering event + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_content`. + public var eventContent: Swift.String? + /// Identifiers for tracking + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_identifiers`. + public var eventIdentifiers: [Swift.String]? + /// Type of resource associated with this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_type`. + public var resourceType: Swift.String? + /// Resource ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_id`. + public var resourceId: Swift.Int64? + /// Resource number (e.g., PR number) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_number`. + public var resourceNumber: Swift.Int32? + /// GraphQL global ID of the resource + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_global_id`. + public var resourceGlobalId: Swift.String? + /// State of the associated resource + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_state`. + public var resourceState: Swift.String? + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/base_ref`. + public var baseRef: Swift.String? + /// GitHub Actions workflow run ID + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/workflow_run_id`. + public var workflowRunId: Swift.Int64? + /// Model used for this session + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/model`. + public var model: Swift.String? + /// Premium request count + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/premium_requests`. + public var premiumRequests: Swift.Double? + /// 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`. + public struct _ErrorPayload: Codable, Hashable, Sendable { + /// Error message + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error/message`. + public var message: Swift.String? + /// Creates a new `_ErrorPayload`. + /// + /// - Parameters: + /// - message: Error message + public init(message: Swift.String? = nil) { + self.message = message + } + public enum CodingKeys: String, CodingKey { + case message + } + } + /// 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`. + public var error: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? + /// Creates a new `SessionsPayloadPayload`. + /// + /// - Parameters: + /// - id: Session ID + /// - name: Session name + /// - user: The user who created this session + /// - owner: The owner of the repository + /// - repository: The repository this session belongs to + /// - agentId: Agent ID + /// - agentTaskId: Agent internal task ID + /// - taskId: Task ID this session belongs to + /// - state: Current state of a session + /// - createdAt: Creation timestamp + /// - updatedAt: Last update timestamp + /// - completedAt: Completion timestamp + /// - eventType: Type of event that triggered this session + /// - eventUrl: URL of the triggering event + /// - eventContent: Content of the triggering event + /// - eventIdentifiers: Identifiers for tracking + /// - resourceType: Type of resource associated with this session + /// - resourceId: Resource ID + /// - resourceNumber: Resource number (e.g., PR number) + /// - resourceGlobalId: GraphQL global ID of the resource + /// - resourceState: State of the associated resource + /// - headRef: Head branch name + /// - baseRef: Base branch name + /// - workflowRunId: GitHub Actions workflow run ID + /// - model: Model used for this session + /// - premiumRequests: Premium request count + /// - error: Error details for a failed session + public init( + id: Swift.String, + name: Swift.String? = nil, + user: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? = nil, + owner: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? = nil, + agentId: Swift.Int64? = nil, + agentTaskId: Swift.String? = nil, + taskId: Swift.String? = nil, + state: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload, + createdAt: Foundation.Date, + updatedAt: Foundation.Date? = nil, + completedAt: Foundation.Date? = nil, + eventType: Swift.String? = nil, + eventUrl: Swift.String? = nil, + eventContent: Swift.String? = nil, + eventIdentifiers: [Swift.String]? = nil, + resourceType: Swift.String? = nil, + resourceId: Swift.Int64? = nil, + resourceNumber: Swift.Int32? = nil, + resourceGlobalId: Swift.String? = nil, + resourceState: Swift.String? = nil, + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil, + workflowRunId: Swift.Int64? = nil, + model: Swift.String? = nil, + premiumRequests: Swift.Double? = nil, + error: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? = nil + ) { + self.id = id + self.name = name + self.user = user + self.owner = owner + self.repository = repository + self.agentId = agentId + self.agentTaskId = agentTaskId + self.taskId = taskId + self.state = state + self.createdAt = createdAt + self.updatedAt = updatedAt + self.completedAt = completedAt + self.eventType = eventType + self.eventUrl = eventUrl + self.eventContent = eventContent + self.eventIdentifiers = eventIdentifiers + self.resourceType = resourceType + self.resourceId = resourceId + self.resourceNumber = resourceNumber + self.resourceGlobalId = resourceGlobalId + self.resourceState = resourceState + self.headRef = headRef + self.baseRef = baseRef + self.workflowRunId = workflowRunId + self.model = model + self.premiumRequests = premiumRequests + self.error = error + } + public enum CodingKeys: String, CodingKey { + case id + case name + case user + case owner + case repository + case agentId = "agent_id" + case agentTaskId = "agent_task_id" + case taskId = "task_id" + case state + case createdAt = "created_at" + case updatedAt = "updated_at" + case completedAt = "completed_at" + case eventType = "event_type" + case eventUrl = "event_url" + case eventContent = "event_content" + case eventIdentifiers = "event_identifiers" + case resourceType = "resource_type" + case resourceId = "resource_id" + case resourceNumber = "resource_number" + case resourceGlobalId = "resource_global_id" + case resourceState = "resource_state" + case headRef = "head_ref" + case baseRef = "base_ref" + case workflowRunId = "workflow_run_id" + case model + case premiumRequests = "premium_requests" + case error + } + } + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public typealias SessionsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload] + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public var sessions: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - sessions: Sessions associated with this task + public init(sessions: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? = nil) { + self.sessions = sessions + } + public enum CodingKeys: String, CodingKey { + case sessions + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/json/value2`. + public var value2: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value2Payload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload.Value1Payload, + value2: Operations.AgentTasksGetTaskByRepoAndId.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/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.Ok.Body) { + self.body = body + } + } + /// Task retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.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.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad request + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.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.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksGetTaskByRepoAndId.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.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/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/404/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.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.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.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/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/repos/{owner}/{repo}/tasks/{task_id}/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskByRepoAndId.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/repos/{owner}/{repo}/tasks/{task_id}/get(agent-tasks/get-task-by-repo-and-id)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksGetTaskByRepoAndId.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.AgentTasksGetTaskByRepoAndId.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 + ] + } + } + } + /// List tasks + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a list of tasks for the authenticated user + /// + /// + /// - Remark: HTTP `GET /agents/tasks`. + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)`. + public enum AgentTasksListTasks { + public static let id: Swift.String = "agent-tasks/list-tasks" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/query`. + public struct Query: Sendable, Hashable { + /// The number of results per page (max 100). + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/per_page`. + public var perPage: Swift.Int? + /// The page number of the results to fetch. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/page`. + public var page: Swift.Int? + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/sort`. + @frozen public enum SortPayload: String, Codable, Hashable, Sendable, CaseIterable { + case updatedAt = "updated_at" + case createdAt = "created_at" + } + /// The field to sort results by. Can be `updated_at` or `created_at`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/sort`. + public var sort: Operations.AgentTasksListTasks.Input.Query.SortPayload? + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/direction`. + @frozen public enum DirectionPayload: String, Codable, Hashable, Sendable, CaseIterable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort results. Can be `asc` or `desc`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/direction`. + public var direction: Operations.AgentTasksListTasks.Input.Query.DirectionPayload? + /// Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/state`. + public var state: Swift.String? + /// Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/is_archived`. + public var isArchived: Swift.Bool? + /// Only show tasks updated at or after this time (ISO 8601 timestamp) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/query/since`. + public var since: Foundation.Date? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - perPage: The number of results per page (max 100). + /// - page: The page number of the results to fetch. + /// - sort: The field to sort results by. Can be `updated_at` or `created_at`. + /// - direction: The direction to sort results. Can be `asc` or `desc`. + /// - state: Comma-separated list of task states to filter by. Can be any combination of: `queued`, `in_progress`, `completed`, `failed`, `idle`, `waiting_for_user`, `timed_out`, `cancelled`. + /// - isArchived: Filter by archived status. When `true`, returns only archived tasks. When `false` or omitted, returns only non-archived tasks. Defaults to `false`. + /// - since: Only show tasks updated at or after this time (ISO 8601 timestamp) + public init( + perPage: Swift.Int? = nil, + page: Swift.Int? = nil, + sort: Operations.AgentTasksListTasks.Input.Query.SortPayload? = nil, + direction: Operations.AgentTasksListTasks.Input.Query.DirectionPayload? = nil, + state: Swift.String? = nil, + isArchived: Swift.Bool? = nil, + since: Foundation.Date? = nil + ) { + self.perPage = perPage + self.page = page + self.sort = sort + self.direction = direction + self.state = state + self.isArchived = isArchived + self.since = since + } + } + public var query: Operations.AgentTasksListTasks.Input.Query + /// - Remark: Generated from `#/paths/agents/tasks/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.AgentTasksListTasks.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - query: + /// - headers: + public init( + query: Operations.AgentTasksListTasks.Input.Query = .init(), + headers: Operations.AgentTasksListTasks.Input.Headers = .init() + ) { + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// Pagination links. Contains rel="first" (always), + /// rel="next" (when more pages exist), and rel="last" (when on the final page). + /// + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/headers/Link`. + public var link: Swift.String? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - link: Pagination links. Contains rel="first" (always), + public init(link: Swift.String? = nil) { + self.link = link + } + } + /// Received HTTP response headers + public var headers: Operations.AgentTasksListTasks.Output.Ok.Headers + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload`. + public struct TasksPayloadPayload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator/case1`. + case case1(Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload.Case1Payload) + 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) + } + 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) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator`. + public var creator: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/creator_type`. + public var creatorType: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/owner`. + public var owner: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/repository`. + public var repository: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/state`. + public var state: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case githubResource = "github_resource" + case branch = "branch" + } + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64? + /// Resource type (e.g., pull_request, issue) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/type`. + public var _type: Swift.String? + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - _type: Resource type (e.g., pull_request, issue) + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64? = nil, + _type: Swift.String? = nil, + globalId: Swift.String? = nil + ) { + self.id = id + self._type = _type + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + 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 .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 value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/ArtifactsPayload/data`. + public var data: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Discriminator for data shape + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/artifacts`. + public var artifacts: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/TasksPayload/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `TasksPayloadPayload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - 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 + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.RepositoryPayload? = nil, + state: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/tasks`. + public typealias TasksPayload = [Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayloadPayload] + /// List of tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/tasks`. + public var tasks: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayload + /// Total count of active (non-archived) tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/total_active_count`. + public var totalActiveCount: Swift.Int32? + /// Total count of archived tasks + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/json/total_archived_count`. + public var totalArchivedCount: Swift.Int32? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - tasks: List of tasks + /// - totalActiveCount: Total count of active (non-archived) tasks + /// - totalArchivedCount: Total count of archived tasks + public init( + tasks: Operations.AgentTasksListTasks.Output.Ok.Body.JsonPayload.TasksPayload, + totalActiveCount: Swift.Int32? = nil, + totalArchivedCount: Swift.Int32? = nil + ) { + self.tasks = tasks + self.totalActiveCount = totalActiveCount + self.totalArchivedCount = totalArchivedCount + } + public enum CodingKeys: String, CodingKey { + case tasks + case totalActiveCount = "total_active_count" + case totalArchivedCount = "total_archived_count" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.AgentTasksListTasks.Output.Ok.Headers = .init(), + body: Operations.AgentTasksListTasks.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Tasks retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksListTasks.Output.BadRequest.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.AgentTasksListTasks.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.BadRequest.Body) { + self.body = body + } + } + /// Bad request + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksListTasks.Output.Unauthorized.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.AgentTasksListTasks.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksListTasks.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksListTasks.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.AgentTasksListTasks.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksListTasks.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.AgentTasksListTasks.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksListTasks.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/tasks/get(agent-tasks/list-tasks)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksListTasks.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.AgentTasksListTasks.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 task by ID + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Returns a task by ID with its associated sessions + /// + /// + /// - Remark: HTTP `GET /agents/tasks/{task_id}`. + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)`. + public enum AgentTasksGetTaskById { + public static let id: Swift.String = "agent-tasks/get-task-by-id" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The unique identifier of the task. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/path/task_id`. + public var taskId: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - taskId: The unique identifier of the task. + public init(taskId: Swift.String) { + self.taskId = taskId + } + } + public var path: Operations.AgentTasksGetTaskById.Input.Path + /// - Remark: Generated from `#/paths/agents/tasks/{task_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.AgentTasksGetTaskById.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.AgentTasksGetTaskById.Input.Path, + headers: Operations.AgentTasksGetTaskById.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// Unique task identifier + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/id`. + public var id: Swift.String + /// API URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/url`. + public var url: Swift.String? + /// Web URL for this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/html_url`. + public var htmlUrl: Swift.String? + /// Human-readable name derived from the task prompt + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/name`. + public var name: Swift.String? + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + @frozen public enum CreatorPayload: Codable, Hashable, Sendable { + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1/id`. + public var id: Swift.Int64? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator/case1`. + case case1(Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload.Case1Payload) + 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) + } + 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) + } + } + } + /// The entity who created this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator`. + public var creator: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + @frozen public enum CreatorTypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case user = "user" + case organization = "organization" + } + /// Type of the task creator + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/creator_type`. + public var creatorType: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? + /// A GitHub user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload`. + public struct UserCollaboratorsPayloadPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/UserCollaboratorsPayload/id`. + public var id: Swift.Int64? + /// Creates a new `UserCollaboratorsPayloadPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + public typealias UserCollaboratorsPayload = [Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayloadPayload] + /// User objects of collaborators on this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/user_collaborators`. + @available(*, deprecated) + public var userCollaborators: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/owner`. + public var owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this task belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/repository`. + public var repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of the task, derived from its most recent session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/state`. + public var state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload + /// Number of sessions in this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/session_count`. + public var sessionCount: Swift.Int32? + /// A resource generated by the task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload`. + public struct ArtifactsPayloadPayload: Codable, Hashable, Sendable { + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + @frozen public enum ProviderPayload: String, Codable, Hashable, Sendable, CaseIterable { + case github = "github" + } + /// Provider namespace + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/provider`. + public var provider: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case githubResource = "github_resource" + case branch = "branch" + } + /// Discriminator for data shape + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/type`. + public var _type: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + @frozen public enum DataPayload: Codable, Hashable, Sendable { + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// GitHub resource ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/id`. + public var id: Swift.Int64? + /// Resource type (e.g., pull_request, issue) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/type`. + public var _type: Swift.String? + /// GraphQL global ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1/global_id`. + public var globalId: Swift.String? + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - id: GitHub resource ID + /// - _type: Resource type (e.g., pull_request, issue) + /// - globalId: GraphQL global ID + public init( + id: Swift.Int64? = nil, + _type: Swift.String? = nil, + globalId: Swift.String? = nil + ) { + self.id = id + self._type = _type + self.globalId = globalId + } + public enum CodingKeys: String, CodingKey { + case id + case _type = "type" + case globalId = "global_id" + } + } + /// A GitHub resource (pull request, issue, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case1`. + case case1(Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case1Payload) + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2/base_ref`. + public var baseRef: Swift.String? + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - headRef: Head branch name + /// - baseRef: Base branch name + public init( + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil + ) { + self.headRef = headRef + self.baseRef = baseRef + } + public enum CodingKeys: String, CodingKey { + case headRef = "head_ref" + case baseRef = "base_ref" + } + } + /// A Git branch reference + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data/case2`. + case case2(Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload.Case2Payload) + 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 .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 value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + } + } + } + /// Resource data (shape depends on type) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/ArtifactsPayload/data`. + public var data: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + /// Creates a new `ArtifactsPayloadPayload`. + /// + /// - Parameters: + /// - provider: Provider namespace + /// - _type: Discriminator for data shape + /// - data: Resource data (shape depends on type) + public init( + provider: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.ProviderPayload, + _type: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload._TypePayload, + data: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload.DataPayload + ) { + self.provider = provider + self._type = _type + self.data = data + } + public enum CodingKeys: String, CodingKey { + case provider + case _type = "type" + case data + } + } + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public typealias ArtifactsPayload = [Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayloadPayload] + /// Resources created by this task (PRs, branches, etc.) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/artifacts`. + public var artifacts: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? + /// Timestamp when the task was archived, null if not archived + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/archived_at`. + public var archivedAt: Foundation.Date? + /// Timestamp of the most recent update + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/updated_at`. + public var updatedAt: Foundation.Date? + /// Timestamp when the task was created + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1/created_at`. + public var createdAt: Foundation.Date + /// Creates a new `Value1Payload`. + /// + /// - Parameters: + /// - id: Unique task identifier + /// - url: API URL for this task + /// - htmlUrl: Web URL for this task + /// - name: Human-readable name derived from the task prompt + /// - creator: The entity who created this task + /// - creatorType: Type of the task creator + /// - userCollaborators: User objects of collaborators on this task + /// - owner: The owner of the repository + /// - repository: The repository this task belongs to + /// - state: Current state of the task, derived from its most recent session + /// - sessionCount: Number of sessions in this task + /// - artifacts: Resources created by this task (PRs, branches, etc.) + /// - 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 + public init( + id: Swift.String, + url: Swift.String? = nil, + htmlUrl: Swift.String? = nil, + name: Swift.String? = nil, + creator: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorPayload? = nil, + creatorType: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.CreatorTypePayload? = nil, + userCollaborators: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.UserCollaboratorsPayload? = nil, + owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.RepositoryPayload? = nil, + state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.StatePayload, + sessionCount: Swift.Int32? = nil, + artifacts: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload.ArtifactsPayload? = nil, + archivedAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + createdAt: Foundation.Date + ) { + self.id = id + self.url = url + self.htmlUrl = htmlUrl + self.name = name + self.creator = creator + self.creatorType = creatorType + self.userCollaborators = userCollaborators + self.owner = owner + self.repository = repository + self.state = state + self.sessionCount = sessionCount + self.artifacts = artifacts + self.archivedAt = archivedAt + self.updatedAt = updatedAt + self.createdAt = createdAt + } + public enum CodingKeys: String, CodingKey { + case id + case url + case htmlUrl = "html_url" + case name + case creator + case creatorType = "creator_type" + case userCollaborators = "user_collaborators" + case owner + case repository + case state + case sessionCount = "session_count" + case artifacts + case archivedAt = "archived_at" + case updatedAt = "updated_at" + case createdAt = "created_at" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value1`. + public var value1: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// Full session details within a task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload`. + public struct SessionsPayloadPayload: Codable, Hashable, Sendable { + /// Session ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/id`. + public var id: Swift.String + /// Session name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/name`. + public var name: Swift.String? + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public struct UserPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user/id`. + public var id: Swift.Int64? + /// Creates a new `UserPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The user who created this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/user`. + public var user: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public struct OwnerPayload: Codable, Hashable, Sendable { + /// The unique identifier of the user + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner/id`. + public var id: Swift.Int64? + /// Creates a new `OwnerPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the user + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The owner of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/owner`. + public var owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public struct RepositoryPayload: Codable, Hashable, Sendable { + /// The unique identifier of the repository + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository/id`. + public var id: Swift.Int64? + /// Creates a new `RepositoryPayload`. + /// + /// - Parameters: + /// - id: The unique identifier of the repository + public init(id: Swift.Int64? = nil) { + self.id = id + } + public enum CodingKeys: String, CodingKey { + case id + } + } + /// The repository this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/repository`. + public var repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? + /// Agent ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/agent_id`. + public var agentId: Swift.Int64? + /// Agent internal task ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/agent_task_id`. + public var agentTaskId: Swift.String? + /// Task ID this session belongs to + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/task_id`. + public var taskId: Swift.String? + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case queued = "queued" + case inProgress = "in_progress" + case completed = "completed" + case failed = "failed" + case idle = "idle" + case waitingForUser = "waiting_for_user" + case timedOut = "timed_out" + case cancelled = "cancelled" + } + /// Current state of a session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/state`. + public var state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload + /// Creation timestamp + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/created_at`. + public var createdAt: Foundation.Date + /// Last update timestamp + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/updated_at`. + public var updatedAt: Foundation.Date? + /// Completion timestamp + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/completed_at`. + public var completedAt: Foundation.Date? + /// Type of event that triggered this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_type`. + public var eventType: Swift.String? + /// URL of the triggering event + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_url`. + public var eventUrl: Swift.String? + /// Content of the triggering event + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_content`. + public var eventContent: Swift.String? + /// Identifiers for tracking + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/event_identifiers`. + public var eventIdentifiers: [Swift.String]? + /// Type of resource associated with this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_type`. + public var resourceType: Swift.String? + /// Resource ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_id`. + public var resourceId: Swift.Int64? + /// Resource number (e.g., PR number) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_number`. + public var resourceNumber: Swift.Int32? + /// GraphQL global ID of the resource + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_global_id`. + public var resourceGlobalId: Swift.String? + /// State of the associated resource + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/resource_state`. + public var resourceState: Swift.String? + /// Head branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/head_ref`. + public var headRef: Swift.String? + /// Base branch name + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/base_ref`. + public var baseRef: Swift.String? + /// GitHub Actions workflow run ID + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/workflow_run_id`. + public var workflowRunId: Swift.Int64? + /// Model used for this session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/model`. + public var model: Swift.String? + /// Premium request count + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/premium_requests`. + public var premiumRequests: Swift.Double? + /// Error details for a failed session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. + public struct _ErrorPayload: Codable, Hashable, Sendable { + /// Error message + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error/message`. + public var message: Swift.String? + /// Creates a new `_ErrorPayload`. + /// + /// - Parameters: + /// - message: Error message + public init(message: Swift.String? = nil) { + self.message = message + } + public enum CodingKeys: String, CodingKey { + case message + } + } + /// Error details for a failed session + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/SessionsPayload/error`. + public var error: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? + /// Creates a new `SessionsPayloadPayload`. + /// + /// - Parameters: + /// - id: Session ID + /// - name: Session name + /// - user: The user who created this session + /// - owner: The owner of the repository + /// - repository: The repository this session belongs to + /// - agentId: Agent ID + /// - agentTaskId: Agent internal task ID + /// - taskId: Task ID this session belongs to + /// - state: Current state of a session + /// - createdAt: Creation timestamp + /// - updatedAt: Last update timestamp + /// - completedAt: Completion timestamp + /// - eventType: Type of event that triggered this session + /// - eventUrl: URL of the triggering event + /// - eventContent: Content of the triggering event + /// - eventIdentifiers: Identifiers for tracking + /// - resourceType: Type of resource associated with this session + /// - resourceId: Resource ID + /// - resourceNumber: Resource number (e.g., PR number) + /// - resourceGlobalId: GraphQL global ID of the resource + /// - resourceState: State of the associated resource + /// - headRef: Head branch name + /// - baseRef: Base branch name + /// - workflowRunId: GitHub Actions workflow run ID + /// - model: Model used for this session + /// - premiumRequests: Premium request count + /// - error: Error details for a failed session + public init( + id: Swift.String, + name: Swift.String? = nil, + user: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.UserPayload? = nil, + owner: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.OwnerPayload? = nil, + repository: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.RepositoryPayload? = nil, + agentId: Swift.Int64? = nil, + agentTaskId: Swift.String? = nil, + taskId: Swift.String? = nil, + state: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload.StatePayload, + createdAt: Foundation.Date, + updatedAt: Foundation.Date? = nil, + completedAt: Foundation.Date? = nil, + eventType: Swift.String? = nil, + eventUrl: Swift.String? = nil, + eventContent: Swift.String? = nil, + eventIdentifiers: [Swift.String]? = nil, + resourceType: Swift.String? = nil, + resourceId: Swift.Int64? = nil, + resourceNumber: Swift.Int32? = nil, + resourceGlobalId: Swift.String? = nil, + resourceState: Swift.String? = nil, + headRef: Swift.String? = nil, + baseRef: Swift.String? = nil, + workflowRunId: Swift.Int64? = nil, + model: Swift.String? = nil, + premiumRequests: Swift.Double? = nil, + error: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload._ErrorPayload? = nil + ) { + self.id = id + self.name = name + self.user = user + self.owner = owner + self.repository = repository + self.agentId = agentId + self.agentTaskId = agentTaskId + self.taskId = taskId + self.state = state + self.createdAt = createdAt + self.updatedAt = updatedAt + self.completedAt = completedAt + self.eventType = eventType + self.eventUrl = eventUrl + self.eventContent = eventContent + self.eventIdentifiers = eventIdentifiers + self.resourceType = resourceType + self.resourceId = resourceId + self.resourceNumber = resourceNumber + self.resourceGlobalId = resourceGlobalId + self.resourceState = resourceState + self.headRef = headRef + self.baseRef = baseRef + self.workflowRunId = workflowRunId + self.model = model + self.premiumRequests = premiumRequests + self.error = error + } + public enum CodingKeys: String, CodingKey { + case id + case name + case user + case owner + case repository + case agentId = "agent_id" + case agentTaskId = "agent_task_id" + case taskId = "task_id" + case state + case createdAt = "created_at" + case updatedAt = "updated_at" + case completedAt = "completed_at" + case eventType = "event_type" + case eventUrl = "event_url" + case eventContent = "event_content" + case eventIdentifiers = "event_identifiers" + case resourceType = "resource_type" + case resourceId = "resource_id" + case resourceNumber = "resource_number" + case resourceGlobalId = "resource_global_id" + case resourceState = "resource_state" + case headRef = "head_ref" + case baseRef = "base_ref" + case workflowRunId = "workflow_run_id" + case model + case premiumRequests = "premium_requests" + case error + } + } + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public typealias SessionsPayload = [Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayloadPayload] + /// Sessions associated with this task + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2/sessions`. + public var sessions: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - sessions: Sessions associated with this task + public init(sessions: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload.SessionsPayload? = nil) { + self.sessions = sessions + } + public enum CodingKeys: String, CodingKey { + case sessions + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/200/content/json/value2`. + public var value2: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value2Payload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Operations.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload.Value1Payload, + value2: Operations.AgentTasksGetTaskById.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/agents/tasks/{task_id}/GET/responses/200/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.Ok.Body) { + self.body = body + } + } + /// Task retrieved successfully + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/400/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.Output.BadRequest.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.AgentTasksGetTaskById.Output.BadRequest.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.BadRequest.Body) { + self.body = body + } + } + /// Problems parsing request + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/401/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.Output.Unauthorized.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.AgentTasksGetTaskById.Output.Unauthorized.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.Unauthorized.Body) { + self.body = body + } + } + /// Authentication required + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.AgentTasksGetTaskById.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.AgentTasksGetTaskById.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/403/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.AgentTasksGetTaskById.Output.Forbidden.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.Forbidden.Body) { + self.body = body + } + } + /// Insufficient permissions + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.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/agents/tasks/{task_id}/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/404/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.Output.NotFound.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.AgentTasksGetTaskById.Output.NotFound.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.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/agents/tasks/{task_id}/GET/responses/422/content`. + @frozen public enum Body: Sendable, Hashable { + /// Structured error response following GitHub REST API conventions. + /// For 422 Unprocessable Entity the errors array contains validation + /// details; for other error status codes only message and + /// documentation_url are returned. + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// Summary message (e.g. "Validation Failed", "Not Found") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/message`. + public var message: Swift.String + /// A single validation error + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload`. + public struct ErrorsPayloadPayload: Codable, Hashable, Sendable { + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + @frozen public enum CodePayload: String, Codable, Hashable, Sendable, CaseIterable { + case missing = "missing" + case missingField = "missing_field" + case invalid = "invalid" + case alreadyExists = "already_exists" + case unprocessable = "unprocessable" + case custom = "custom" + } + /// Machine-readable error code + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/code`. + public var code: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload + /// Human-readable message (populated when code is "custom") + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/ErrorsPayload/message`. + public var message: Swift.String? + /// Creates a new `ErrorsPayloadPayload`. + /// + /// - Parameters: + /// - code: Machine-readable error code + /// - message: Human-readable message (populated when code is "custom") + public init( + code: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload.CodePayload, + message: Swift.String? = nil + ) { + self.code = code + self.message = message + } + public enum CodingKeys: String, CodingKey { + case code + case message + } + } + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/errors`. + public typealias ErrorsPayload = [Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayloadPayload] + /// List of validation errors (present only for 422 responses) + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/errors`. + public var errors: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? + /// URL to relevant API documentation + /// + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/json/documentation_url`. + public var documentationUrl: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - message: Summary message (e.g. "Validation Failed", "Not Found") + /// - errors: List of validation errors (present only for 422 responses) + /// - documentationUrl: URL to relevant API documentation + public init( + message: Swift.String, + errors: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload.ErrorsPayload? = nil, + documentationUrl: Swift.String + ) { + self.message = message + self.errors = errors + self.documentationUrl = documentationUrl + } + public enum CodingKeys: String, CodingKey { + case message + case errors + case documentationUrl = "documentation_url" + } + } + /// - Remark: Generated from `#/paths/agents/tasks/{task_id}/GET/responses/422/content/application\/json`. + case json(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.Output.UnprocessableContent.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body + /// Creates a new `UnprocessableContent`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.AgentTasksGetTaskById.Output.UnprocessableContent.Body) { + self.body = body + } + } + /// Validation Failed + /// + /// - Remark: Generated from `#/paths//agents/tasks/{task_id}/get(agent-tasks/get-task-by-id)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.AgentTasksGetTaskById.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.AgentTasksGetTaskById.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 + ] + } + } + } +} From ca1fb95c4c3c78652edc88fac4147b90b67b57c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:04:31 +0000 Subject: [PATCH 26/27] Commit via running: make Package.swift --- Package.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Package.swift b/Package.swift index 47ab49678f..37131ac882 100644 --- a/Package.swift +++ b/Package.swift @@ -13,6 +13,7 @@ let package = Package( products: [ .library(name: "GitHubRestAPIActions", targets: ["GitHubRestAPIActions"]), .library(name: "GitHubRestAPIActivity", targets: ["GitHubRestAPIActivity"]), + .library(name: "GitHubRestAPIAgent_Tasks", targets: ["GitHubRestAPIAgent_Tasks"]), .library(name: "GitHubRestAPIApps", targets: ["GitHubRestAPIApps"]), .library(name: "GitHubRestAPIBilling", targets: ["GitHubRestAPIBilling"]), .library(name: "GitHubRestAPICampaigns", targets: ["GitHubRestAPICampaigns"]), @@ -79,6 +80,14 @@ let package = Package( ], path: "Sources/activity" ), + .target( + name: "GitHubRestAPIAgent_Tasks", + dependencies: [ + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"), + ], + path: "Sources/agent-tasks" + ), .target( name: "GitHubRestAPIApps", dependencies: [ From 04d2d9f024cb88e9dfedefc0fb1a6ffb55a4b635 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:04:32 +0000 Subject: [PATCH 27/27] Commit via running: make .spi.yml --- .spi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.spi.yml b/.spi.yml index 85b1a64ceb..999ac4d663 100644 --- a/.spi.yml +++ b/.spi.yml @@ -4,6 +4,7 @@ builder: - documentation_targets: - GitHubRestAPIActions - GitHubRestAPIActivity + - GitHubRestAPIAgent_Tasks - GitHubRestAPIApps - GitHubRestAPIBilling - GitHubRestAPICampaigns