From c2ae2be028a5fd62e75916a62de266c7ce255e8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:26:46 +0000 Subject: [PATCH 1/7] Bump Submodule/github/rest-api-description from `7a0a14c` to `1847198` Bumps [Submodule/github/rest-api-description](https://github.com/github/rest-api-description) from `7a0a14c` to `1847198`. - [Release notes](https://github.com/github/rest-api-description/releases) - [Commits](https://github.com/github/rest-api-description/compare/7a0a14cf24805c7efd23fef351bfab80391ec8fb...1847198856aa730d19ac7fef6f2617ecbec8e01e) --- updated-dependencies: - dependency-name: Submodule/github/rest-api-description dependency-version: 1847198856aa730d19ac7fef6f2617ecbec8e01e 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 7a0a14cf24..1847198856 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 7a0a14cf24805c7efd23fef351bfab80391ec8fb +Subproject commit 1847198856aa730d19ac7fef6f2617ecbec8e01e From 39bdc63731fa42876393a6cc7b4bff35abeb1707 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:32:10 +0000 Subject: [PATCH 2/7] Commit via running: make Sources/billing --- Sources/billing/Types.swift | 84 +++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 12 deletions(-) diff --git a/Sources/billing/Types.swift b/Sources/billing/Types.swift index 762356f1aa..66b0d3dedd 100644 --- a/Sources/billing/Types.swift +++ b/Sources/billing/Types.swift @@ -3969,22 +3969,32 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_entity_name`. public var budgetEntityName: Swift.String? - /// The type of pricing for the budget + /// The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. + /// + /// - `BundlePricing`: Covers all AI credit SKUs. Set `budget_product_sku` to `ai_credits`. + /// - `ProductPricing`: Covers all SKUs that belong to a product. Set `budget_product_sku` to a product such as `actions` or `packages`. + /// - `SkuPricing`: Covers a single, specific SKU. Set `budget_product_sku` to a SKU such as `actions_linux`. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type`. @frozen public enum BudgetTypePayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type/case1`. @frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable { - case productPricing = "ProductPricing" + case bundlePricing = "BundlePricing" } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type/case1`. case case1(Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetTypePayload.Case1Payload) /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type/case2`. @frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable { - case skuPricing = "SkuPricing" + case productPricing = "ProductPricing" } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type/case2`. case case2(Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetTypePayload.Case2Payload) + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type/case3`. + @frozen public enum Case3Payload: String, Codable, Hashable, Sendable, CaseIterable { + case skuPricing = "SkuPricing" + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type/case3`. + case case3(Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetTypePayload.Case3Payload) public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] do { @@ -3999,6 +4009,12 @@ public enum Operations { } catch { errors.append(error) } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -4011,10 +4027,16 @@ public enum Operations { try encoder.encodeToSingleValueContainer(value) case let .case2(value): try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) } } } - /// The type of pricing for the budget + /// The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. + /// + /// - `BundlePricing`: Covers all AI credit SKUs. Set `budget_product_sku` to `ai_credits`. + /// - `ProductPricing`: Covers all SKUs that belong to a product. Set `budget_product_sku` to a product such as `actions` or `packages`. + /// - `SkuPricing`: Covers a single, specific SKU. Set `budget_product_sku` to a SKU such as `actions_linux`. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_type`. public var budgetType: Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetTypePayload? @@ -4022,6 +4044,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/budget_product_sku`. public var budgetProductSku: Swift.String? + /// The username of the user for `user` scope budgets. This field is required when `budget_scope` is `user`. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/json/user`. + public var user: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -4030,8 +4056,9 @@ public enum Operations { /// - budgetAlerting: /// - budgetScope: The scope of the budget for this organization. Use 'organization' for org-level budgets or 'repository' for repo-specific budgets within the organization. `user` and `multi_user_customer` scopes are only supported when `budget_product_sku` is `ai_credits` or `premium_requests`. /// - budgetEntityName: The name of the entity to apply the budget to - /// - budgetType: The type of pricing for the budget + /// - budgetType: The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. /// - budgetProductSku: A single product or SKU that will be covered in the budget + /// - user: The username of the user for `user` scope budgets. This field is required when `budget_scope` is `user`. public init( budgetAmount: Swift.Int? = nil, preventFurtherUsage: Swift.Bool? = nil, @@ -4039,7 +4066,8 @@ public enum Operations { budgetScope: Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetScopePayload? = nil, budgetEntityName: Swift.String? = nil, budgetType: Operations.BillingCreateOrganizationBudget.Input.Body.JsonPayload.BudgetTypePayload? = nil, - budgetProductSku: Swift.String? = nil + budgetProductSku: Swift.String? = nil, + user: Swift.String? = nil ) { self.budgetAmount = budgetAmount self.preventFurtherUsage = preventFurtherUsage @@ -4048,6 +4076,7 @@ public enum Operations { self.budgetEntityName = budgetEntityName self.budgetType = budgetType self.budgetProductSku = budgetProductSku + self.user = user } public enum CodingKeys: String, CodingKey { case budgetAmount = "budget_amount" @@ -4057,6 +4086,7 @@ public enum Operations { case budgetEntityName = "budget_entity_name" case budgetType = "budget_type" case budgetProductSku = "budget_product_sku" + case user } } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/POST/requestBody/content/application\/json`. @@ -4729,22 +4759,32 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_entity_name`. public var budgetEntityName: Swift.String? - /// The type of pricing for the budget + /// The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. + /// + /// - `BundlePricing`: Covers all AI credit SKUs. Set `budget_product_sku` to `ai_credits`. + /// - `ProductPricing`: Covers all SKUs that belong to a product. Set `budget_product_sku` to a product such as `actions` or `packages`. + /// - `SkuPricing`: Covers a single, specific SKU. Set `budget_product_sku` to a SKU such as `actions_linux`. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type`. @frozen public enum BudgetTypePayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case1`. @frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable { - case productPricing = "ProductPricing" + case bundlePricing = "BundlePricing" } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case1`. case case1(Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload.Case1Payload) /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case2`. @frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable { - case skuPricing = "SkuPricing" + case productPricing = "ProductPricing" } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case2`. case case2(Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload.Case2Payload) + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case3`. + @frozen public enum Case3Payload: String, Codable, Hashable, Sendable, CaseIterable { + case skuPricing = "SkuPricing" + } + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type/case3`. + case case3(Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload.Case3Payload) public init(from decoder: any Swift.Decoder) throws { var errors: [any Swift.Error] = [] do { @@ -4759,6 +4799,12 @@ public enum Operations { } catch { errors.append(error) } + do { + self = .case3(try decoder.decodeFromSingleValueContainer()) + return + } catch { + errors.append(error) + } throw Swift.DecodingError.failedToDecodeOneOfSchema( type: Self.self, codingPath: decoder.codingPath, @@ -4771,10 +4817,16 @@ public enum Operations { try encoder.encodeToSingleValueContainer(value) case let .case2(value): try encoder.encodeToSingleValueContainer(value) + case let .case3(value): + try encoder.encodeToSingleValueContainer(value) } } } - /// The type of pricing for the budget + /// The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. + /// + /// - `BundlePricing`: Covers all AI credit SKUs. Set `budget_product_sku` to `ai_credits`. + /// - `ProductPricing`: Covers all SKUs that belong to a product. Set `budget_product_sku` to a product such as `actions` or `packages`. + /// - `SkuPricing`: Covers a single, specific SKU. Set `budget_product_sku` to a SKU such as `actions_linux`. /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_type`. public var budgetType: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload? @@ -4782,6 +4834,10 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/budget_product_sku`. public var budgetProductSku: Swift.String? + /// The username of the user for `user` scope budgets. + /// + /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/json/user`. + public var user: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -4790,8 +4846,9 @@ public enum Operations { /// - budgetAlerting: /// - budgetScope: The scope of the budget /// - budgetEntityName: The name of the entity to apply the budget to - /// - budgetType: The type of pricing for the budget + /// - budgetType: The type of pricing model used by the budget. Determines how `budget_product_sku` is interpreted. /// - budgetProductSku: A single product or SKU that will be covered in the budget + /// - user: The username of the user for `user` scope budgets. public init( budgetAmount: Swift.Int? = nil, preventFurtherUsage: Swift.Bool? = nil, @@ -4799,7 +4856,8 @@ public enum Operations { budgetScope: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetScopePayload? = nil, budgetEntityName: Swift.String? = nil, budgetType: Operations.BillingUpdateBudgetOrg.Input.Body.JsonPayload.BudgetTypePayload? = nil, - budgetProductSku: Swift.String? = nil + budgetProductSku: Swift.String? = nil, + user: Swift.String? = nil ) { self.budgetAmount = budgetAmount self.preventFurtherUsage = preventFurtherUsage @@ -4808,6 +4866,7 @@ public enum Operations { self.budgetEntityName = budgetEntityName self.budgetType = budgetType self.budgetProductSku = budgetProductSku + self.user = user } public enum CodingKeys: String, CodingKey { case budgetAmount = "budget_amount" @@ -4817,6 +4876,7 @@ public enum Operations { case budgetEntityName = "budget_entity_name" case budgetType = "budget_type" case budgetProductSku = "budget_product_sku" + case user } } /// - Remark: Generated from `#/paths/organizations/{org}/settings/billing/budgets/{budget_id}/PATCH/requestBody/content/application\/json`. From 8ba495aa4d1cbd81bdca1cc0fc996d4323e6bc7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:38:50 +0000 Subject: [PATCH 3/7] Commit via running: make Sources/orgs --- Sources/orgs/Client.swift | 4 ++-- Sources/orgs/Types.swift | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index 5bad6ac063..59110c5275 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -904,9 +904,9 @@ public struct Client: APIProtocol { } /// List artifact storage records /// - /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// List artifact storage records with a given subject digest for repositories owned by an organization. /// - /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// Results are filtered by the authenticated user's permissions; records for repositories the user cannot read are omitted. Fine-grained access tokens require the `artifact-metadata:read` permission. /// /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 598b6b952f..109e170235 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -117,9 +117,9 @@ public protocol APIProtocol: Sendable { func orgsListArtifactDeploymentRecords(_ input: Operations.OrgsListArtifactDeploymentRecords.Input) async throws -> Operations.OrgsListArtifactDeploymentRecords.Output /// List artifact storage records /// - /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// List artifact storage records with a given subject digest for repositories owned by an organization. /// - /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// Results are filtered by the authenticated user's permissions; records for repositories the user cannot read are omitted. Fine-grained access tokens require the `artifact-metadata:read` permission. /// /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. @@ -1253,9 +1253,9 @@ extension APIProtocol { } /// List artifact storage records /// - /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// List artifact storage records with a given subject digest for repositories owned by an organization. /// - /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// Results are filtered by the authenticated user's permissions; records for repositories the user cannot read are omitted. Fine-grained access tokens require the `artifact-metadata:read` permission. /// /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. @@ -12877,9 +12877,9 @@ public enum Operations { } /// List artifact storage records /// - /// List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization. + /// List artifact storage records with a given subject digest for repositories owned by an organization. /// - /// The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `content:read` permission is required. + /// Results are filtered by the authenticated user's permissions; records for repositories the user cannot read are omitted. Fine-grained access tokens require the `artifact-metadata:read` permission. /// /// - Remark: HTTP `GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records`. /// - Remark: Generated from `#/paths//orgs/{org}/artifacts/{subject_digest}/metadata/storage-records/get(orgs/list-artifact-storage-records)`. From 92a9f623f8824106319e9002251495a542a2a797 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:40:01 +0000 Subject: [PATCH 4/7] Commit via running: make Sources/rate-limit --- Sources/rate-limit/Client.swift | 1 - Sources/rate-limit/Types.swift | 17 +++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Sources/rate-limit/Client.swift b/Sources/rate-limit/Client.swift index d6aa4ad18c..351b87896d 100644 --- a/Sources/rate-limit/Client.swift +++ b/Sources/rate-limit/Client.swift @@ -51,7 +51,6 @@ public struct Client: APIProtocol { /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." - /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// diff --git a/Sources/rate-limit/Types.swift b/Sources/rate-limit/Types.swift index d198364519..1b5f2c10dc 100644 --- a/Sources/rate-limit/Types.swift +++ b/Sources/rate-limit/Types.swift @@ -24,7 +24,6 @@ public protocol APIProtocol: Sendable { /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." - /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// @@ -51,7 +50,6 @@ extension APIProtocol { /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." - /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// @@ -178,8 +176,6 @@ public enum Components { public var sourceImport: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/integration_manifest`. public var integrationManifest: Components.Schemas.RateLimit? - /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/code_scanning_upload`. - public var codeScanningUpload: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/actions_runner_registration`. public var actionsRunnerRegistration: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/scim`. @@ -190,6 +186,8 @@ public enum Components { public var dependencySbom: Components.Schemas.RateLimit? /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/code_scanning_autofix`. public var codeScanningAutofix: Components.Schemas.RateLimit? + /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources/copilot_usage_records`. + public var copilotUsageRecords: Components.Schemas.RateLimit? /// Creates a new `ResourcesPayload`. /// /// - Parameters: @@ -199,12 +197,12 @@ public enum Components { /// - codeSearch: /// - sourceImport: /// - integrationManifest: - /// - codeScanningUpload: /// - actionsRunnerRegistration: /// - scim: /// - dependencySnapshots: /// - dependencySbom: /// - codeScanningAutofix: + /// - copilotUsageRecords: public init( core: Components.Schemas.RateLimit, graphql: Components.Schemas.RateLimit? = nil, @@ -212,12 +210,12 @@ public enum Components { codeSearch: Components.Schemas.RateLimit? = nil, sourceImport: Components.Schemas.RateLimit? = nil, integrationManifest: Components.Schemas.RateLimit? = nil, - codeScanningUpload: Components.Schemas.RateLimit? = nil, actionsRunnerRegistration: Components.Schemas.RateLimit? = nil, scim: Components.Schemas.RateLimit? = nil, dependencySnapshots: Components.Schemas.RateLimit? = nil, dependencySbom: Components.Schemas.RateLimit? = nil, - codeScanningAutofix: Components.Schemas.RateLimit? = nil + codeScanningAutofix: Components.Schemas.RateLimit? = nil, + copilotUsageRecords: Components.Schemas.RateLimit? = nil ) { self.core = core self.graphql = graphql @@ -225,12 +223,12 @@ public enum Components { self.codeSearch = codeSearch self.sourceImport = sourceImport self.integrationManifest = integrationManifest - self.codeScanningUpload = codeScanningUpload self.actionsRunnerRegistration = actionsRunnerRegistration self.scim = scim self.dependencySnapshots = dependencySnapshots self.dependencySbom = dependencySbom self.codeScanningAutofix = codeScanningAutofix + self.copilotUsageRecords = copilotUsageRecords } public enum CodingKeys: String, CodingKey { case core @@ -239,12 +237,12 @@ public enum Components { case codeSearch = "code_search" case sourceImport = "source_import" case integrationManifest = "integration_manifest" - case codeScanningUpload = "code_scanning_upload" case actionsRunnerRegistration = "actions_runner_registration" case scim case dependencySnapshots = "dependency_snapshots" case dependencySbom = "dependency_sbom" case codeScanningAutofix = "code_scanning_autofix" + case copilotUsageRecords = "copilot_usage_records" } } /// - Remark: Generated from `#/components/schemas/rate-limit-overview/resources`. @@ -334,7 +332,6 @@ public enum Operations { /// * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." /// * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." /// * The `dependency_sbom` object provides your rate limit status for requesting SBOMs from the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." - /// * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." /// * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." /// * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/about-the-rest-api/api-versions)." /// From ad946c8ba0d34a59b417cf79e4757d373fc8c5e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:40:49 +0000 Subject: [PATCH 5/7] Commit via running: make Sources/repos --- Sources/repos/Client.swift | 89 ++++++++++++ Sources/repos/Types.swift | 282 +++++++++++++++++++++++++++++++++++++ 2 files changed, 371 insertions(+) diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index df77dc1dd1..5d0e1e749f 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -12876,6 +12876,95 @@ public struct Client: APIProtocol { } ) } + /// List issue types for a repository + /// + /// Lists issue types available for a repository (inherited from its organization owner, with any per-repository overrides applied). + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Fine-grained access tokens require the "Metadata" repository permission (read). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issue-types`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issue-types/get(repos/list-issue-types)`. + public func reposListIssueTypes(_ input: Operations.ReposListIssueTypes.Input) async throws -> Operations.ReposListIssueTypes.Output { + try await client.send( + input: input, + forOperation: Operations.ReposListIssueTypes.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/issue-types", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ReposListIssueTypes.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.IssueType].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.BasicError.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List deploy keys /// /// diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 5c5d60d3da..586b5fefdd 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -1425,6 +1425,15 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/invitations/{invitation_id}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/invitations/{invitation_id}/delete(repos/delete-invitation)`. func reposDeleteInvitation(_ input: Operations.ReposDeleteInvitation.Input) async throws -> Operations.ReposDeleteInvitation.Output + /// List issue types for a repository + /// + /// Lists issue types available for a repository (inherited from its organization owner, with any per-repository overrides applied). + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Fine-grained access tokens require the "Metadata" repository permission (read). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issue-types`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issue-types/get(repos/list-issue-types)`. + func reposListIssueTypes(_ input: Operations.ReposListIssueTypes.Input) async throws -> Operations.ReposListIssueTypes.Output /// List deploy keys /// /// @@ -4601,6 +4610,23 @@ extension APIProtocol { public func reposDeleteInvitation(path: Operations.ReposDeleteInvitation.Input.Path) async throws -> Operations.ReposDeleteInvitation.Output { try await reposDeleteInvitation(Operations.ReposDeleteInvitation.Input(path: path)) } + /// List issue types for a repository + /// + /// Lists issue types available for a repository (inherited from its organization owner, with any per-repository overrides applied). + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Fine-grained access tokens require the "Metadata" repository permission (read). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issue-types`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issue-types/get(repos/list-issue-types)`. + public func reposListIssueTypes( + path: Operations.ReposListIssueTypes.Input.Path, + headers: Operations.ReposListIssueTypes.Input.Headers = .init() + ) async throws -> Operations.ReposListIssueTypes.Output { + try await reposListIssueTypes(Operations.ReposListIssueTypes.Input( + path: path, + headers: headers + )) + } /// List deploy keys /// /// @@ -8265,6 +8291,96 @@ public enum Components { case dueOn = "due_on" } } + /// The type assigned to the issue. This is only present for issues in repositories where issue types are supported. + /// + /// - Remark: Generated from `#/components/schemas/issue-type`. + public struct IssueType: Codable, Hashable, Sendable { + /// The unique identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/id`. + public var id: Swift.Int + /// The node identifier of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/node_id`. + public var nodeId: Swift.String + /// The name of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/name`. + public var name: Swift.String + /// The description of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/description`. + public var description: Swift.String? + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + @frozen public enum ColorPayload: String, Codable, Hashable, Sendable, CaseIterable { + case gray = "gray" + case blue = "blue" + case green = "green" + case yellow = "yellow" + case orange = "orange" + case red = "red" + case pink = "pink" + case purple = "purple" + } + /// The color of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/color`. + public var color: Components.Schemas.IssueType.ColorPayload? + /// The time the issue type created. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/created_at`. + public var createdAt: Foundation.Date? + /// The time the issue type last updated. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/updated_at`. + public var updatedAt: Foundation.Date? + /// The enabled state of the issue type. + /// + /// - Remark: Generated from `#/components/schemas/issue-type/is_enabled`. + public var isEnabled: Swift.Bool? + /// Creates a new `IssueType`. + /// + /// - Parameters: + /// - id: The unique identifier of the issue type. + /// - nodeId: The node identifier of the issue type. + /// - name: The name of the issue type. + /// - description: The description of the issue type. + /// - color: The color of the issue type. + /// - createdAt: The time the issue type created. + /// - updatedAt: The time the issue type last updated. + /// - isEnabled: The enabled state of the issue type. + public init( + id: Swift.Int, + nodeId: Swift.String, + name: Swift.String, + description: Swift.String? = nil, + color: Components.Schemas.IssueType.ColorPayload? = nil, + createdAt: Foundation.Date? = nil, + updatedAt: Foundation.Date? = nil, + isEnabled: Swift.Bool? = nil + ) { + self.id = id + self.nodeId = nodeId + self.name = name + self.description = description + self.color = color + self.createdAt = createdAt + self.updatedAt = updatedAt + self.isEnabled = isEnabled + } + public enum CodingKeys: String, CodingKey { + case id + case nodeId = "node_id" + case name + case description + case color + case createdAt = "created_at" + case updatedAt = "updated_at" + case isEnabled = "is_enabled" + } + } /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. /// /// - Remark: Generated from `#/components/schemas/nullable-integration`. @@ -51471,6 +51587,172 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } + /// List issue types for a repository + /// + /// Lists issue types available for a repository (inherited from its organization owner, with any per-repository overrides applied). + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. + /// Fine-grained access tokens require the "Metadata" repository permission (read). + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/issue-types`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issue-types/get(repos/list-issue-types)`. + public enum ReposListIssueTypes { + public static let id: Swift.String = "repos/list-issue-types" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issue-types/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issue-types/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issue-types/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.ReposListIssueTypes.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issue-types/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.ReposListIssueTypes.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ReposListIssueTypes.Input.Path, + headers: Operations.ReposListIssueTypes.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issue-types/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/issue-types/GET/responses/200/content/application\/json`. + case json([Components.Schemas.IssueType]) + /// 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.IssueType] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ReposListIssueTypes.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ReposListIssueTypes.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issue-types/get(repos/list-issue-types)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ReposListIssueTypes.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.ReposListIssueTypes.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/issue-types/get(repos/list-issue-types)/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 deploy keys /// /// From e34e281e30b2e41af4f163d83c38fbb6f4645d87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:43:34 +0000 Subject: [PATCH 6/7] Commit via running: make Sources/copilot --- Sources/copilot/Client.swift | 385 -------- Sources/copilot/Types.swift | 1812 +++------------------------------- 2 files changed, 117 insertions(+), 2080 deletions(-) diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 3a2639eaec..75e0a4c422 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -3510,198 +3510,6 @@ public struct Client: APIProtocol { } ) } - /// 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 func copilotCopilotMetricsForOrganization(_ input: Operations.CopilotCopilotMetricsForOrganization.Input) async throws -> Operations.CopilotCopilotMetricsForOrganization.Output { - try await client.send( - input: input, - forOperation: Operations.CopilotCopilotMetricsForOrganization.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/copilot/metrics", - 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: "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 - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotCopilotMetricsForOrganization.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.CopilotUsageMetricsDay].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 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.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, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } /// 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. @@ -4584,199 +4392,6 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot metrics for a team - /// - /// 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 team had **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 containing the team within GitHub settings. - /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. - /// - /// 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}/team/{team_slug}/copilot/metrics`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. - public func copilotCopilotMetricsForTeam(_ input: Operations.CopilotCopilotMetricsForTeam.Input) async throws -> Operations.CopilotCopilotMetricsForTeam.Output { - try await client.send( - input: input, - forOperation: Operations.CopilotCopilotMetricsForTeam.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/orgs/{}/team/{}/copilot/metrics", - parameters: [ - input.path.org, - input.path.teamSlug - ] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - 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 - ) - return (request, nil) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CopilotCopilotMetricsForTeam.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.CopilotUsageMetricsDay].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 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.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, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } /// Get Copilot cloud agent configuration for a repository /// /// > [!NOTE] diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index e1062d8008..2643fbcc7e 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -357,25 +357,6 @@ public protocol APIProtocol: Sendable { /// - 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)`. func copilotSetCopilotContentExclusionForOrganization(_ input: Operations.CopilotSetCopilotContentExclusionForOrganization.Input) async throws -> Operations.CopilotSetCopilotContentExclusionForOrganization.Output - /// 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)`. - 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. @@ -468,25 +449,6 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /orgs/{org}/members/{username}/copilot`. /// - Remark: Generated from `#/paths//orgs/{org}/members/{username}/copilot/get(copilot/get-copilot-seat-details-for-user)`. func copilotGetCopilotSeatDetailsForUser(_ input: Operations.CopilotGetCopilotSeatDetailsForUser.Input) async throws -> Operations.CopilotGetCopilotSeatDetailsForUser.Output - /// Get Copilot metrics for a team - /// - /// 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 team had **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 containing the team within GitHub settings. - /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. - /// - /// 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}/team/{team_slug}/copilot/metrics`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. - func copilotCopilotMetricsForTeam(_ input: Operations.CopilotCopilotMetricsForTeam.Input) async throws -> Operations.CopilotCopilotMetricsForTeam.Output /// Get Copilot cloud agent configuration for a repository /// /// > [!NOTE] @@ -1057,35 +1019,6 @@ extension APIProtocol { body: body )) } - /// 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 func copilotCopilotMetricsForOrganization( - path: Operations.CopilotCopilotMetricsForOrganization.Input.Path, - query: Operations.CopilotCopilotMetricsForOrganization.Input.Query = .init(), - headers: Operations.CopilotCopilotMetricsForOrganization.Input.Headers = .init() - ) async throws -> Operations.CopilotCopilotMetricsForOrganization.Output { - try await copilotCopilotMetricsForOrganization(Operations.CopilotCopilotMetricsForOrganization.Input( - path: path, - query: query, - 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. @@ -1232,35 +1165,6 @@ extension APIProtocol { headers: headers )) } - /// Get Copilot metrics for a team - /// - /// 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 team had **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 containing the team within GitHub settings. - /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. - /// - /// 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}/team/{team_slug}/copilot/metrics`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. - public func copilotCopilotMetricsForTeam( - path: Operations.CopilotCopilotMetricsForTeam.Input.Path, - query: Operations.CopilotCopilotMetricsForTeam.Input.Query = .init(), - headers: Operations.CopilotCopilotMetricsForTeam.Input.Headers = .init() - ) async throws -> Operations.CopilotCopilotMetricsForTeam.Output { - try await copilotCopilotMetricsForTeam(Operations.CopilotCopilotMetricsForTeam.Input( - path: path, - query: query, - headers: headers - )) - } /// Get Copilot cloud agent configuration for a repository /// /// > [!NOTE] @@ -3921,990 +3825,99 @@ public enum Components { try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Usage metrics for Copilot editor code completions in the IDE. + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions`. - public struct CopilotIdeCodeCompletions: Codable, Hashable, Sendable { - /// Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Usage metrics for a given language for the given editor for Copilot code completions. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload`. - public struct LanguagesPayloadPayload: Codable, Hashable, Sendable { - /// Name of the language used for Copilot code completion suggestions. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload/name`. - public var name: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/LanguagesPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Creates a new `LanguagesPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the language used for Copilot code completion suggestions. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - } - } - /// Code completion metrics for active languages. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. - public typealias LanguagesPayload = [Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayloadPayload] - /// Code completion metrics for active languages. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. - public var languages: Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload? - /// Copilot code completion metrics for active editors. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload`. - public struct EditorsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/name`. - public var name: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. + /// - Remark: Generated from `#/components/parameters/per-page`. + public typealias PerPage = Swift.Int + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/components/parameters/page`. + public typealias Page = Swift.Int + /// The slug version of the enterprise name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias Enterprise = Swift.String + /// The 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`. + public typealias Username = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias Org = Swift.String + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/owner`. + public typealias Owner = Swift.String + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/repo`. + public typealias Repo = Swift.String + /// The unique identifier of the repository. + /// + /// - Remark: Generated from `#/components/parameters/repository-id`. + public typealias RepositoryId = Swift.Int + } + /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. + public enum RequestBodies {} + /// Types generated from the `#/components/responses` section of the OpenAPI document. + public enum Responses { + public struct ValidationFailedSimple: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. + case json(Components.Schemas.ValidationErrorSimple) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Usage metrics for a given language for the given editor for Copilot code completions. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload`. - public struct LanguagesPayloadPayload: Codable, Hashable, Sendable { - /// Name of the language used for Copilot code completion suggestions, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/name`. - public var name: Swift.String? - /// Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// The number of Copilot code suggestions generated for the given editor, for the given language. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_suggestions`. - public var totalCodeSuggestions: Swift.Int? - /// The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_acceptances`. - public var totalCodeAcceptances: Swift.Int? - /// The number of lines of code suggested by Copilot code completions for the given editor, for the given language. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_lines_suggested`. - public var totalCodeLinesSuggested: Swift.Int? - /// The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/LanguagesPayload/total_code_lines_accepted`. - public var totalCodeLinesAccepted: Swift.Int? - /// Creates a new `LanguagesPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances. - /// - totalCodeSuggestions: The number of Copilot code suggestions generated for the given editor, for the given language. - /// - totalCodeAcceptances: The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. - /// - totalCodeLinesSuggested: The number of lines of code suggested by Copilot code completions for the given editor, for the given language. - /// - totalCodeLinesAccepted: The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - totalCodeSuggestions: Swift.Int? = nil, - totalCodeAcceptances: Swift.Int? = nil, - totalCodeLinesSuggested: Swift.Int? = nil, - totalCodeLinesAccepted: Swift.Int? = nil - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.totalCodeSuggestions = totalCodeSuggestions - self.totalCodeAcceptances = totalCodeAcceptances - self.totalCodeLinesSuggested = totalCodeLinesSuggested - self.totalCodeLinesAccepted = totalCodeLinesAccepted - } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case totalCodeSuggestions = "total_code_suggestions" - case totalCodeAcceptances = "total_code_acceptances" - case totalCodeLinesSuggested = "total_code_lines_suggested" - case totalCodeLinesAccepted = "total_code_lines_accepted" + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ValidationErrorSimple { + get throws { + switch self { + case let .json(body): + return body } } - /// Code completion metrics for active languages, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/languages`. - public typealias LanguagesPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayloadPayload] - /// Code completion metrics for active languages, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/ModelsPayload/languages`. - public var languages: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayload? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot code completion suggestions. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances. - /// - languages: Code completion metrics for active languages, for the given editor. - public init( - name: Swift.String? = nil, - isCustomModel: Swift.Bool? = nil, - customModelTrainingDate: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - languages: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload.LanguagesPayload? = nil - ) { - self.name = name - self.isCustomModel = isCustomModel - self.customModelTrainingDate = customModelTrainingDate - self.totalEngagedUsers = totalEngagedUsers - self.languages = languages - } - public enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalEngagedUsers = "total_engaged_users" - case languages - } - } - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayloadPayload] - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/EditorsPayload/models`. - public var models: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `EditorsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the given editor. - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances. - /// - models: List of model metrics for custom models and the default model. - /// - additionalProperties: A container of undocumented properties. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.models = models - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case models - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.name = try container.decodeIfPresent( - Swift.String.self, - forKey: .name - ) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.models = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload.ModelsPayload.self, - forKey: .models - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "name", - "total_engaged_users", - "models" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.name, - forKey: .name - ) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.models, - forKey: .models - ) - try encoder.encodeAdditionalProperties(additionalProperties) } } - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. - public typealias EditorsPayload = [Components.Schemas.CopilotIdeCodeCompletions.EditorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. - public var editors: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotIdeCodeCompletions`. + /// Received HTTP response body + public var body: Components.Responses.ValidationFailedSimple.Body + /// Creates a new `ValidationFailedSimple`. /// /// - Parameters: - /// - totalEngagedUsers: Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances. - /// - languages: Code completion metrics for active languages. - /// - editors: - /// - additionalProperties: A container of undocumented properties. - public init( - totalEngagedUsers: Swift.Int? = nil, - languages: Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload? = nil, - editors: Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.totalEngagedUsers = totalEngagedUsers - self.languages = languages - self.editors = editors - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case languages - case editors - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.languages = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.LanguagesPayload.self, - forKey: .languages - ) - self.editors = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.EditorsPayload.self, - forKey: .editors - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "languages", - "editors" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.languages, - forKey: .languages - ) - try container.encodeIfPresent( - self.editors, - forKey: .editors - ) - try encoder.encodeAdditionalProperties(additionalProperties) + /// - body: Received HTTP response body + public init(body: Components.Responses.ValidationFailedSimple.Body) { + self.body = body } } - /// Usage metrics for Copilot Chat in the IDE. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat`. - public struct CopilotIdeChat: Codable, Hashable, Sendable { - /// Total number of users who prompted Copilot Chat in the IDE. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Copilot Chat metrics, for active editors. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload`. - public struct EditorsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/name`. - public var name: Swift.String? - /// The number of users who prompted Copilot Chat in the specified editor. + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// The number of users who prompted Copilot Chat in the given editor and model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// The total number of chats initiated by users in the given editor and model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chats`. - public var totalChats: Swift.Int? - /// The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chat_insertion_events`. - public var totalChatInsertionEvents: Swift.Int? - /// The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/ModelsPayload/total_chat_copy_events`. - public var totalChatCopyEvents: Swift.Int? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model. - /// - totalEngagedUsers: The number of users who prompted Copilot Chat in the given editor and model. - /// - totalChats: The total number of chats initiated by users in the given editor and model. - /// - totalChatInsertionEvents: The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. - /// - totalChatCopyEvents: The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor. - public init( - name: Swift.String? = nil, - isCustomModel: Swift.Bool? = nil, - customModelTrainingDate: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - totalChats: Swift.Int? = nil, - totalChatInsertionEvents: Swift.Int? = nil, - totalChatCopyEvents: Swift.Int? = nil - ) { - self.name = name - self.isCustomModel = isCustomModel - self.customModelTrainingDate = customModelTrainingDate - self.totalEngagedUsers = totalEngagedUsers - self.totalChats = totalChats - self.totalChatInsertionEvents = totalChatInsertionEvents - self.totalChatCopyEvents = totalChatCopyEvents - } - public enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalEngagedUsers = "total_engaged_users" - case totalChats = "total_chats" - case totalChatInsertionEvents = "total_chat_insertion_events" - case totalChatCopyEvents = "total_chat_copy_events" + /// - 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 + } } } - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayloadPayload] - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/EditorsPayload/models`. - public var models: Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayload? - /// Creates a new `EditorsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the given editor. - /// - totalEngagedUsers: The number of users who prompted Copilot Chat in the specified editor. - /// - models: List of model metrics for custom models and the default model. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotIdeChat.EditorsPayloadPayload.ModelsPayload? = nil - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.models = models - } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case models - } } - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. - public typealias EditorsPayload = [Components.Schemas.CopilotIdeChat.EditorsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. - public var editors: Components.Schemas.CopilotIdeChat.EditorsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotIdeChat`. - /// - /// - Parameters: - /// - totalEngagedUsers: Total number of users who prompted Copilot Chat in the IDE. - /// - editors: - /// - additionalProperties: A container of undocumented properties. - public init( - totalEngagedUsers: Swift.Int? = nil, - editors: Components.Schemas.CopilotIdeChat.EditorsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.totalEngagedUsers = totalEngagedUsers - self.editors = editors - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case editors - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.editors = try container.decodeIfPresent( - Components.Schemas.CopilotIdeChat.EditorsPayload.self, - forKey: .editors - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "editors" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.editors, - forKey: .editors - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// Usage metrics for Copilot Chat in GitHub.com - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat`. - public struct CopilotDotcomChat: Codable, Hashable, Sendable { - /// Total number of users who prompted Copilot Chat on github.com at least once. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model (if applicable). - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// Total number of users who prompted Copilot Chat on github.com at least once for each model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Total number of chats initiated by users on github.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/ModelsPayload/total_chats`. - public var totalChats: Swift.Int? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot Chat. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model (if applicable). - /// - totalEngagedUsers: Total number of users who prompted Copilot Chat on github.com at least once for each model. - /// - totalChats: Total number of chats initiated by users on github.com. - public init( - name: Swift.String? = nil, - isCustomModel: Swift.Bool? = nil, - customModelTrainingDate: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - totalChats: Swift.Int? = nil - ) { - self.name = name - self.isCustomModel = isCustomModel - self.customModelTrainingDate = customModelTrainingDate - self.totalEngagedUsers = totalEngagedUsers - self.totalChats = totalChats - } - public enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalEngagedUsers = "total_engaged_users" - case totalChats = "total_chats" - } - } - /// List of model metrics for a custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotDotcomChat.ModelsPayloadPayload] - /// List of model metrics for a custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. - public var models: Components.Schemas.CopilotDotcomChat.ModelsPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotDotcomChat`. - /// - /// - Parameters: - /// - totalEngagedUsers: Total number of users who prompted Copilot Chat on github.com at least once. - /// - models: List of model metrics for a custom models and the default model. - /// - additionalProperties: A container of undocumented properties. - public init( - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotDotcomChat.ModelsPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.totalEngagedUsers = totalEngagedUsers - self.models = models - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case models - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.models = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomChat.ModelsPayload.self, - forKey: .models - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "models" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.models, - forKey: .models - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// Usage metrics for Copilot for pull requests. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests`. - public struct CopilotDotcomPullRequests: Codable, Hashable, Sendable { - /// The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload`. - public struct RepositoriesPayloadPayload: Codable, Hashable, Sendable { - /// Repository name - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/name`. - public var name: Swift.String? - /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload`. - public struct ModelsPayloadPayload: Codable, Hashable, Sendable { - /// Name of the model used for Copilot pull request summaries. If the default model is used will appear as 'default'. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/name`. - public var name: Swift.String? - /// Indicates whether a model is custom or default. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/is_custom_model`. - public var isCustomModel: Swift.Bool? - /// The training date for the custom model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/custom_model_training_date`. - public var customModelTrainingDate: Swift.String? - /// The number of pull request summaries generated using Copilot for Pull Requests in the given repository. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/total_pr_summaries_created`. - public var totalPrSummariesCreated: Swift.Int? - /// The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/ModelsPayload/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// Creates a new `ModelsPayloadPayload`. - /// - /// - Parameters: - /// - name: Name of the model used for Copilot pull request summaries. If the default model is used will appear as 'default'. - /// - isCustomModel: Indicates whether a model is custom or default. - /// - customModelTrainingDate: The training date for the custom model. - /// - totalPrSummariesCreated: The number of pull request summaries generated using Copilot for Pull Requests in the given repository. - /// - totalEngagedUsers: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model. - public init( - name: Swift.String? = nil, - isCustomModel: Swift.Bool? = nil, - customModelTrainingDate: Swift.String? = nil, - totalPrSummariesCreated: Swift.Int? = nil, - totalEngagedUsers: Swift.Int? = nil - ) { - self.name = name - self.isCustomModel = isCustomModel - self.customModelTrainingDate = customModelTrainingDate - self.totalPrSummariesCreated = totalPrSummariesCreated - self.totalEngagedUsers = totalEngagedUsers - } - public enum CodingKeys: String, CodingKey { - case name - case isCustomModel = "is_custom_model" - case customModelTrainingDate = "custom_model_training_date" - case totalPrSummariesCreated = "total_pr_summaries_created" - case totalEngagedUsers = "total_engaged_users" - } - } - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/models`. - public typealias ModelsPayload = [Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayloadPayload] - /// List of model metrics for custom models and the default model. - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/RepositoriesPayload/models`. - public var models: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayload? - /// Creates a new `RepositoriesPayloadPayload`. - /// - /// - Parameters: - /// - name: Repository name - /// - totalEngagedUsers: The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository. - /// - models: List of model metrics for custom models and the default model. - public init( - name: Swift.String? = nil, - totalEngagedUsers: Swift.Int? = nil, - models: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload.ModelsPayload? = nil - ) { - self.name = name - self.totalEngagedUsers = totalEngagedUsers - self.models = models - } - public enum CodingKeys: String, CodingKey { - case name - case totalEngagedUsers = "total_engaged_users" - case models - } - } - /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. - public typealias RepositoriesPayload = [Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayloadPayload] - /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries - /// - /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. - public var repositories: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotDotcomPullRequests`. - /// - /// - Parameters: - /// - totalEngagedUsers: The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once. - /// - repositories: Repositories in which users used Copilot for Pull Requests to generate pull request summaries - /// - additionalProperties: A container of undocumented properties. - public init( - totalEngagedUsers: Swift.Int? = nil, - repositories: Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.totalEngagedUsers = totalEngagedUsers - self.repositories = repositories - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case totalEngagedUsers = "total_engaged_users" - case repositories - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.repositories = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomPullRequests.RepositoriesPayload.self, - forKey: .repositories - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "total_engaged_users", - "repositories" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.repositories, - forKey: .repositories - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// Copilot usage metrics for a given day. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day`. - public struct CopilotUsageMetricsDay: Codable, Hashable, Sendable { - /// The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/date`. - public var date: Swift.String - /// The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_active_users`. - public var totalActiveUsers: Swift.Int? - /// The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/total_engaged_users`. - public var totalEngagedUsers: Swift.Int? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_code_completions`. - public var copilotIdeCodeCompletions: Components.Schemas.CopilotIdeCodeCompletions? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_chat`. - public var copilotIdeChat: Components.Schemas.CopilotIdeChat? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_chat`. - public var copilotDotcomChat: Components.Schemas.CopilotDotcomChat? - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_pull_requests`. - public var copilotDotcomPullRequests: Components.Schemas.CopilotDotcomPullRequests? - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `CopilotUsageMetricsDay`. - /// - /// - Parameters: - /// - date: The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. - /// - totalActiveUsers: The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. - /// - totalEngagedUsers: The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint. - /// - copilotIdeCodeCompletions: - /// - copilotIdeChat: - /// - copilotDotcomChat: - /// - copilotDotcomPullRequests: - /// - additionalProperties: A container of undocumented properties. - public init( - date: Swift.String, - totalActiveUsers: Swift.Int? = nil, - totalEngagedUsers: Swift.Int? = nil, - copilotIdeCodeCompletions: Components.Schemas.CopilotIdeCodeCompletions? = nil, - copilotIdeChat: Components.Schemas.CopilotIdeChat? = nil, - copilotDotcomChat: Components.Schemas.CopilotDotcomChat? = nil, - copilotDotcomPullRequests: Components.Schemas.CopilotDotcomPullRequests? = nil, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.date = date - self.totalActiveUsers = totalActiveUsers - self.totalEngagedUsers = totalEngagedUsers - self.copilotIdeCodeCompletions = copilotIdeCodeCompletions - self.copilotIdeChat = copilotIdeChat - self.copilotDotcomChat = copilotDotcomChat - self.copilotDotcomPullRequests = copilotDotcomPullRequests - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case date - case totalActiveUsers = "total_active_users" - case totalEngagedUsers = "total_engaged_users" - case copilotIdeCodeCompletions = "copilot_ide_code_completions" - case copilotIdeChat = "copilot_ide_chat" - case copilotDotcomChat = "copilot_dotcom_chat" - case copilotDotcomPullRequests = "copilot_dotcom_pull_requests" - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.date = try container.decode( - Swift.String.self, - forKey: .date - ) - self.totalActiveUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalActiveUsers - ) - self.totalEngagedUsers = try container.decodeIfPresent( - Swift.Int.self, - forKey: .totalEngagedUsers - ) - self.copilotIdeCodeCompletions = try container.decodeIfPresent( - Components.Schemas.CopilotIdeCodeCompletions.self, - forKey: .copilotIdeCodeCompletions - ) - self.copilotIdeChat = try container.decodeIfPresent( - Components.Schemas.CopilotIdeChat.self, - forKey: .copilotIdeChat - ) - self.copilotDotcomChat = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomChat.self, - forKey: .copilotDotcomChat - ) - self.copilotDotcomPullRequests = try container.decodeIfPresent( - Components.Schemas.CopilotDotcomPullRequests.self, - forKey: .copilotDotcomPullRequests - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "date", - "total_active_users", - "total_engaged_users", - "copilot_ide_code_completions", - "copilot_ide_chat", - "copilot_dotcom_chat", - "copilot_dotcom_pull_requests" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode( - self.date, - forKey: .date - ) - try container.encodeIfPresent( - self.totalActiveUsers, - forKey: .totalActiveUsers - ) - try container.encodeIfPresent( - self.totalEngagedUsers, - forKey: .totalEngagedUsers - ) - try container.encodeIfPresent( - self.copilotIdeCodeCompletions, - forKey: .copilotIdeCodeCompletions - ) - try container.encodeIfPresent( - self.copilotIdeChat, - forKey: .copilotIdeChat - ) - try container.encodeIfPresent( - self.copilotDotcomChat, - forKey: .copilotDotcomChat - ) - try container.encodeIfPresent( - self.copilotDotcomPullRequests, - forKey: .copilotDotcomPullRequests - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/per-page`. - public typealias PerPage = Swift.Int - /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - /// - /// - Remark: Generated from `#/components/parameters/page`. - public typealias Page = Swift.Int - /// The slug version of the enterprise name. - /// - /// - Remark: Generated from `#/components/parameters/enterprise`. - public typealias Enterprise = Swift.String - /// The 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`. - public typealias Username = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias Org = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias TeamSlug = Swift.String - /// The account owner of the repository. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/owner`. - public typealias Owner = Swift.String - /// The name of the repository without the `.git` extension. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/repo`. - public typealias Repo = Swift.String - /// The unique identifier of the repository. - /// - /// - Remark: Generated from `#/components/parameters/repository-id`. - public typealias RepositoryId = Swift.Int - } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct ValidationFailedSimple: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/validation_failed_simple/content/application\/json`. - case json(Components.Schemas.ValidationErrorSimple) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.ValidationErrorSimple { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.ValidationFailedSimple.Body - /// Creates a new `ValidationFailedSimple`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.ValidationFailedSimple.Body) { - self.body = body - } - } - public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. - case json(Components.Schemas.BasicError) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.BasicError { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Components.Responses.NotFound.Body - /// Creates a new `NotFound`. + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body @@ -5106,40 +4119,12 @@ public enum Components { } 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 { - /// - Remark: Generated from `#/components/responses/too_large/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.TooLarge.Body - /// Creates a new `TooLarge`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.TooLarge.Body) { - self.body = body - } + public init() {} } - public struct UsageMetricsApiDisabled: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content`. + public struct TooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/too_large/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content/application\/json`. + /// - Remark: Generated from `#/components/responses/too_large/content/application\/json`. case json(Components.Schemas.BasicError) /// The associated value of the enum case if `self` is `.json`. /// @@ -5155,12 +4140,12 @@ public enum Components { } } /// Received HTTP response body - public var body: Components.Responses.UsageMetricsApiDisabled.Body - /// Creates a new `UsageMetricsApiDisabled`. + public var body: Components.Responses.TooLarge.Body + /// Creates a new `TooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Components.Responses.UsageMetricsApiDisabled.Body) { + public init(body: Components.Responses.TooLarge.Body) { self.body = body } } @@ -10899,311 +9884,11 @@ public enum Operations { 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): + case let .unauthorized(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "internalServerError", + expectedStatus: "unauthorized", response: self ) } @@ -11211,7 +9896,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/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.Forbidden) @@ -11234,7 +9919,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/content_exclusion/put(copilot/set-copilot-content-exclusion-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.NotFound) @@ -11255,17 +9940,40 @@ public enum Operations { } } } - /// Copilot Usage Metrics API setting is disabled at the organization or enterprise level. + /// 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/metrics/get(copilot/copilot-metrics-for-organization)/responses/422`. + /// - 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.UsageMetricsApiDisabled) + 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.UsageMetricsApiDisabled { + public var unprocessableContent: Components.Responses.ValidationFailedSimple { get throws { switch self { case let .unprocessableContent(response): @@ -12779,292 +11487,6 @@ public enum Operations { } } } - /// Get Copilot metrics for a team - /// - /// 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 team had **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 containing the team within GitHub settings. - /// Only organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team. - /// - /// 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}/team/{team_slug}/copilot/metrics`. - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)`. - public enum CopilotCopilotMetricsForTeam { - public static let id: Swift.String = "copilot/copilot-metrics-for-team" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/path`. - public struct Path: Sendable, Hashable { - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/path/org`. - public var org: Components.Parameters.Org - /// The slug of the team name. - /// - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/copilot/metrics/GET/path/team_slug`. - public var teamSlug: Components.Parameters.TeamSlug - /// Creates a new `Path`. - /// - /// - Parameters: - /// - org: The organization name. The name is not case sensitive. - /// - teamSlug: The slug of the team name. - public init( - org: Components.Parameters.Org, - teamSlug: Components.Parameters.TeamSlug - ) { - self.org = org - self.teamSlug = teamSlug - } - } - public var path: Operations.CopilotCopilotMetricsForTeam.Input.Path - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/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}/team/{team_slug}/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}/team/{team_slug}/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}/team/{team_slug}/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}/team/{team_slug}/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.CopilotCopilotMetricsForTeam.Input.Query - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/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.CopilotCopilotMetricsForTeam.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - query: - /// - headers: - public init( - path: Operations.CopilotCopilotMetricsForTeam.Input.Path, - query: Operations.CopilotCopilotMetricsForTeam.Input.Query = .init(), - headers: Operations.CopilotCopilotMetricsForTeam.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}/team/{team_slug}/copilot/metrics/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/orgs/{org}/team/{team_slug}/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.CopilotCopilotMetricsForTeam.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CopilotCopilotMetricsForTeam.Output.Ok.Body) { - self.body = body - } - } - /// Response - /// - /// - Remark: Generated from `#/paths//orgs/{org}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/responses/200`. - /// - /// HTTP response code: `200 ok`. - case ok(Operations.CopilotCopilotMetricsForTeam.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.CopilotCopilotMetricsForTeam.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}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/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}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/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}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/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}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-team)/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 cloud agent configuration for a repository /// /// > [!NOTE] From d79c1832bb9ef5c582804331ffa5e3c0bb9d7811 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:44:45 +0000 Subject: [PATCH 7/7] Commit via running: make Sources/interactions --- Sources/interactions/Client.swift | 363 +++++++++++ Sources/interactions/Types.swift | 962 ++++++++++++++++++++++++++++++ 2 files changed, 1325 insertions(+) diff --git a/Sources/interactions/Client.swift b/Sources/interactions/Client.swift index c174bba5b6..cf7ab4e32a 100644 --- a/Sources/interactions/Client.swift +++ b/Sources/interactions/Client.swift @@ -421,6 +421,369 @@ public struct Client: APIProtocol { } ) } + /// Get pull request creation cap bypass list for a repository + /// + /// Lists the users that are on the pull request creation cap bypass list for a + /// repository. Users on this list can create pull requests regardless of any + /// configured pull request creation cap. + /// + /// Only repository admins can view the bypass list. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. + public func interactionsGetPullRequestBypassListForRepo(_ input: Operations.InteractionsGetPullRequestBypassListForRepo.Input) async throws -> Operations.InteractionsGetPullRequestBypassListForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.InteractionsGetPullRequestBypassListForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/interaction-limits/pulls/bypass-list", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.InteractionsGetPullRequestBypassListForRepo.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.SimpleUser].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + 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 + ) + ) + } + } + ) + } + /// Add users to the pull request creation cap bypass list for a repository + /// + /// Adds users to the pull request creation cap bypass list for a repository. + /// Users on this list can create pull requests regardless of any configured + /// pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can add a maximum of 100 users per request. + /// The bypass list can only hold a maximum of 100 users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)`. + public func interactionsSetPullRequestBypassListForRepo(_ input: Operations.InteractionsSetPullRequestBypassListForRepo.Input) async throws -> Operations.InteractionsSetPullRequestBypassListForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.InteractionsSetPullRequestBypassListForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/interaction-limits/pulls/bypass-list", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + 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 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 + ) + ) + } + } + ) + } + /// Remove users from the pull request creation cap bypass list for a repository + /// + /// Removes users from the pull request creation cap bypass list for a repository. + /// Removed users will be subject to any configured pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can remove a maximum of 100 users per request. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)`. + public func interactionsRemovePullRequestBypassListForRepo(_ input: Operations.InteractionsRemovePullRequestBypassListForRepo.Input) async throws -> Operations.InteractionsRemovePullRequestBypassListForRepo.Output { + try await client.send( + input: input, + forOperation: Operations.InteractionsRemovePullRequestBypassListForRepo.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/interaction-limits/pulls/bypass-list", + parameters: [ + input.path.owner, + input.path.repo + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 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 + ) + ) + } + } + ) + } /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires. diff --git a/Sources/interactions/Types.swift b/Sources/interactions/Types.swift index 7e6d0783f5..809d791bb6 100644 --- a/Sources/interactions/Types.swift +++ b/Sources/interactions/Types.swift @@ -53,6 +53,41 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/interaction-limits`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/delete(interactions/remove-restrictions-for-repo)`. func interactionsRemoveRestrictionsForRepo(_ input: Operations.InteractionsRemoveRestrictionsForRepo.Input) async throws -> Operations.InteractionsRemoveRestrictionsForRepo.Output + /// Get pull request creation cap bypass list for a repository + /// + /// Lists the users that are on the pull request creation cap bypass list for a + /// repository. Users on this list can create pull requests regardless of any + /// configured pull request creation cap. + /// + /// Only repository admins can view the bypass list. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. + func interactionsGetPullRequestBypassListForRepo(_ input: Operations.InteractionsGetPullRequestBypassListForRepo.Input) async throws -> Operations.InteractionsGetPullRequestBypassListForRepo.Output + /// Add users to the pull request creation cap bypass list for a repository + /// + /// Adds users to the pull request creation cap bypass list for a repository. + /// Users on this list can create pull requests regardless of any configured + /// pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can add a maximum of 100 users per request. + /// The bypass list can only hold a maximum of 100 users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)`. + func interactionsSetPullRequestBypassListForRepo(_ input: Operations.InteractionsSetPullRequestBypassListForRepo.Input) async throws -> Operations.InteractionsSetPullRequestBypassListForRepo.Output + /// Remove users from the pull request creation cap bypass list for a repository + /// + /// Removes users from the pull request creation cap bypass list for a repository. + /// Removed users will be subject to any configured pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can remove a maximum of 100 users per request. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)`. + func interactionsRemovePullRequestBypassListForRepo(_ input: Operations.InteractionsRemovePullRequestBypassListForRepo.Input) async throws -> Operations.InteractionsRemovePullRequestBypassListForRepo.Output /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires. @@ -160,6 +195,69 @@ extension APIProtocol { public func interactionsRemoveRestrictionsForRepo(path: Operations.InteractionsRemoveRestrictionsForRepo.Input.Path) async throws -> Operations.InteractionsRemoveRestrictionsForRepo.Output { try await interactionsRemoveRestrictionsForRepo(Operations.InteractionsRemoveRestrictionsForRepo.Input(path: path)) } + /// Get pull request creation cap bypass list for a repository + /// + /// Lists the users that are on the pull request creation cap bypass list for a + /// repository. Users on this list can create pull requests regardless of any + /// configured pull request creation cap. + /// + /// Only repository admins can view the bypass list. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. + public func interactionsGetPullRequestBypassListForRepo( + path: Operations.InteractionsGetPullRequestBypassListForRepo.Input.Path, + headers: Operations.InteractionsGetPullRequestBypassListForRepo.Input.Headers = .init() + ) async throws -> Operations.InteractionsGetPullRequestBypassListForRepo.Output { + try await interactionsGetPullRequestBypassListForRepo(Operations.InteractionsGetPullRequestBypassListForRepo.Input( + path: path, + headers: headers + )) + } + /// Add users to the pull request creation cap bypass list for a repository + /// + /// Adds users to the pull request creation cap bypass list for a repository. + /// Users on this list can create pull requests regardless of any configured + /// pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can add a maximum of 100 users per request. + /// The bypass list can only hold a maximum of 100 users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)`. + public func interactionsSetPullRequestBypassListForRepo( + path: Operations.InteractionsSetPullRequestBypassListForRepo.Input.Path, + headers: Operations.InteractionsSetPullRequestBypassListForRepo.Input.Headers = .init(), + body: Operations.InteractionsSetPullRequestBypassListForRepo.Input.Body + ) async throws -> Operations.InteractionsSetPullRequestBypassListForRepo.Output { + try await interactionsSetPullRequestBypassListForRepo(Operations.InteractionsSetPullRequestBypassListForRepo.Input( + path: path, + headers: headers, + body: body + )) + } + /// Remove users from the pull request creation cap bypass list for a repository + /// + /// Removes users from the pull request creation cap bypass list for a repository. + /// Removed users will be subject to any configured pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can remove a maximum of 100 users per request. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)`. + public func interactionsRemovePullRequestBypassListForRepo( + path: Operations.InteractionsRemovePullRequestBypassListForRepo.Input.Path, + headers: Operations.InteractionsRemovePullRequestBypassListForRepo.Input.Headers = .init(), + body: Operations.InteractionsRemovePullRequestBypassListForRepo.Input.Body + ) async throws -> Operations.InteractionsRemovePullRequestBypassListForRepo.Output { + try await interactionsRemovePullRequestBypassListForRepo(Operations.InteractionsRemovePullRequestBypassListForRepo.Input( + path: path, + headers: headers, + body: body + )) + } /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires. @@ -218,6 +316,188 @@ public enum Servers { public enum Components { /// Types generated from the `#/components/schemas` section of the OpenAPI document. public enum Schemas { + /// A GitHub user. + /// + /// - Remark: Generated from `#/components/schemas/simple-user`. + public struct SimpleUser: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/simple-user/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/email`. + public var email: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/login`. + public var login: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/id`. + public var id: Swift.Int64 + /// - Remark: Generated from `#/components/schemas/simple-user/node_id`. + public var nodeId: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`. + public var avatarUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`. + public var gravatarId: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/url`. + public var url: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/html_url`. + public var htmlUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/followers_url`. + public var followersUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/following_url`. + public var followingUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/gists_url`. + public var gistsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/starred_url`. + public var starredUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`. + public var subscriptionsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`. + public var organizationsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/repos_url`. + public var reposUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/events_url`. + public var eventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`. + public var receivedEventsUrl: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/type`. + public var _type: Swift.String + /// - Remark: Generated from `#/components/schemas/simple-user/site_admin`. + public var siteAdmin: Swift.Bool + /// - Remark: Generated from `#/components/schemas/simple-user/starred_at`. + public var starredAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`. + public var userViewType: Swift.String? + /// Creates a new `SimpleUser`. + /// + /// - Parameters: + /// - name: + /// - email: + /// - login: + /// - id: + /// - nodeId: + /// - avatarUrl: + /// - gravatarId: + /// - url: + /// - htmlUrl: + /// - followersUrl: + /// - followingUrl: + /// - gistsUrl: + /// - starredUrl: + /// - subscriptionsUrl: + /// - organizationsUrl: + /// - reposUrl: + /// - eventsUrl: + /// - receivedEventsUrl: + /// - _type: + /// - siteAdmin: + /// - starredAt: + /// - userViewType: + public init( + name: Swift.String? = nil, + email: Swift.String? = nil, + login: Swift.String, + id: Swift.Int64, + nodeId: Swift.String, + avatarUrl: Swift.String, + gravatarId: Swift.String? = nil, + url: Swift.String, + htmlUrl: Swift.String, + followersUrl: Swift.String, + followingUrl: Swift.String, + gistsUrl: Swift.String, + starredUrl: Swift.String, + subscriptionsUrl: Swift.String, + organizationsUrl: Swift.String, + reposUrl: Swift.String, + eventsUrl: Swift.String, + receivedEventsUrl: Swift.String, + _type: Swift.String, + siteAdmin: Swift.Bool, + starredAt: Swift.String? = nil, + userViewType: Swift.String? = nil + ) { + self.name = name + self.email = email + self.login = login + self.id = id + self.nodeId = nodeId + self.avatarUrl = avatarUrl + self.gravatarId = gravatarId + self.url = url + self.htmlUrl = htmlUrl + self.followersUrl = followersUrl + self.followingUrl = followingUrl + self.gistsUrl = gistsUrl + self.starredUrl = starredUrl + self.subscriptionsUrl = subscriptionsUrl + self.organizationsUrl = organizationsUrl + self.reposUrl = reposUrl + self.eventsUrl = eventsUrl + self.receivedEventsUrl = receivedEventsUrl + self._type = _type + self.siteAdmin = siteAdmin + self.starredAt = starredAt + self.userViewType = userViewType + } + public enum CodingKeys: String, CodingKey { + case name + case email + case login + case id + case nodeId = "node_id" + case avatarUrl = "avatar_url" + case gravatarId = "gravatar_id" + case url + case htmlUrl = "html_url" + case followersUrl = "followers_url" + case followingUrl = "following_url" + case gistsUrl = "gists_url" + case starredUrl = "starred_url" + case subscriptionsUrl = "subscriptions_url" + case organizationsUrl = "organizations_url" + case reposUrl = "repos_url" + case eventsUrl = "events_url" + case receivedEventsUrl = "received_events_url" + case _type = "type" + case siteAdmin = "site_admin" + case starredAt = "starred_at" + case userViewType = "user_view_type" + } + } + /// Basic Error + /// + /// - Remark: Generated from `#/components/schemas/basic-error`. + public struct BasicError: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/basic-error/message`. + public var message: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`. + public var documentationUrl: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/url`. + public var url: Swift.String? + /// - Remark: Generated from `#/components/schemas/basic-error/status`. + public var status: Swift.String? + /// Creates a new `BasicError`. + /// + /// - Parameters: + /// - message: + /// - documentationUrl: + /// - url: + /// - status: + public init( + message: Swift.String? = nil, + documentationUrl: Swift.String? = nil, + url: Swift.String? = nil, + status: Swift.String? = nil + ) { + self.message = message + self.documentationUrl = documentationUrl + self.url = url + self.status = status + } + public enum CodingKeys: String, CodingKey { + case message + case documentationUrl = "documentation_url" + case url + case status + } + } /// Validation Error /// /// - Remark: Generated from `#/components/schemas/validation-error`. @@ -417,6 +697,25 @@ public enum Components { case expiry } } + /// A list of user logins to add or remove from the pull request creation cap bypass list. + /// + /// - Remark: Generated from `#/components/schemas/interaction-limit-pull-request-bypass-list`. + public struct InteractionLimitPullRequestBypassList: Codable, Hashable, Sendable { + /// A list of user logins to add or remove from the bypass list. + /// + /// - Remark: Generated from `#/components/schemas/interaction-limit-pull-request-bypass-list/users`. + public var users: [Swift.String] + /// Creates a new `InteractionLimitPullRequestBypassList`. + /// + /// - Parameters: + /// - users: A list of user logins to add or remove from the bypass list. + public init(users: [Swift.String]) { + self.users = users + } + public enum CodingKeys: String, CodingKey { + case users + } + } } /// Types generated from the `#/components/parameters` section of the OpenAPI document. public enum Parameters { @@ -437,6 +736,34 @@ public enum Components { public enum RequestBodies {} /// Types generated from the `#/components/responses` section of the OpenAPI document. public enum Responses { + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/not_found/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.NotFound.Body) { + self.body = body + } + } public struct ValidationFailed: Sendable, Hashable { /// - Remark: Generated from `#/components/responses/validation_failed/content`. @frozen public enum Body: Sendable, Hashable { @@ -465,6 +792,34 @@ public enum Components { self.body = body } } + public struct Forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.BasicError) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.BasicError { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.Forbidden.Body + /// Creates a new `Forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.Forbidden.Body) { + self.body = body + } + } } /// Types generated from the `#/components/headers` section of the OpenAPI document. public enum Headers {} @@ -1392,6 +1747,613 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } } + /// Get pull request creation cap bypass list for a repository + /// + /// Lists the users that are on the pull request creation cap bypass list for a + /// repository. Users on this list can create pull requests regardless of any + /// configured pull request creation cap. + /// + /// Only repository admins can view the bypass list. + /// + /// - Remark: HTTP `GET /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)`. + public enum InteractionsGetPullRequestBypassListForRepo { + public static let id: Swift.String = "interactions/get-pull-request-bypass-list-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/GET/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/GET/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/GET/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.InteractionsGetPullRequestBypassListForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/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.InteractionsGetPullRequestBypassListForRepo.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.InteractionsGetPullRequestBypassListForRepo.Input.Path, + headers: Operations.InteractionsGetPullRequestBypassListForRepo.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SimpleUser]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SimpleUser] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.InteractionsGetPullRequestBypassListForRepo.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.InteractionsGetPullRequestBypassListForRepo.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.InteractionsGetPullRequestBypassListForRepo.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.InteractionsGetPullRequestBypassListForRepo.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/get(interactions/get-pull-request-bypass-list-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Add users to the pull request creation cap bypass list for a repository + /// + /// Adds users to the pull request creation cap bypass list for a repository. + /// Users on this list can create pull requests regardless of any configured + /// pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can add a maximum of 100 users per request. + /// The bypass list can only hold a maximum of 100 users. + /// + /// - Remark: HTTP `PUT /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)`. + public enum InteractionsSetPullRequestBypassListForRepo { + public static let id: Swift.String = "interactions/set-pull-request-bypass-list-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/PUT/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/PUT/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/PUT/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.InteractionsSetPullRequestBypassListForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/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.InteractionsSetPullRequestBypassListForRepo.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/PUT/requestBody/content/application\/json`. + case json(Components.Schemas.InteractionLimitPullRequestBypassList) + } + public var body: Operations.InteractionsSetPullRequestBypassListForRepo.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.InteractionsSetPullRequestBypassListForRepo.Input.Path, + headers: Operations.InteractionsSetPullRequestBypassListForRepo.Input.Headers = .init(), + body: Operations.InteractionsSetPullRequestBypassListForRepo.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() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.InteractionsSetPullRequestBypassListForRepo.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)/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.InteractionsSetPullRequestBypassListForRepo.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/put(interactions/set-pull-request-bypass-list-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Remove users from the pull request creation cap bypass list for a repository + /// + /// Removes users from the pull request creation cap bypass list for a repository. + /// Removed users will be subject to any configured pull request creation cap. + /// + /// Only repository admins can modify the bypass list. + /// You can remove a maximum of 100 users per request. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/interaction-limits/pulls/bypass-list`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)`. + public enum InteractionsRemovePullRequestBypassListForRepo { + public static let id: Swift.String = "interactions/remove-pull-request-bypass-list-for-repo" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/DELETE/path`. + public struct Path: Sendable, Hashable { + /// The account owner of the repository. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/DELETE/path/owner`. + public var owner: Components.Parameters.Owner + /// The name of the repository without the `.git` extension. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/DELETE/path/repo`. + public var repo: Components.Parameters.Repo + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + public init( + owner: Components.Parameters.Owner, + repo: Components.Parameters.Repo + ) { + self.owner = owner + self.repo = repo + } + } + public var path: Operations.InteractionsRemovePullRequestBypassListForRepo.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/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.InteractionsRemovePullRequestBypassListForRepo.Input.Headers + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/DELETE/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/DELETE/requestBody/content/application\/json`. + case json(Components.Schemas.InteractionLimitPullRequestBypassList) + } + public var body: Operations.InteractionsRemovePullRequestBypassListForRepo.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.InteractionsRemovePullRequestBypassListForRepo.Input.Path, + headers: Operations.InteractionsRemovePullRequestBypassListForRepo.Input.Headers = .init(), + body: Operations.InteractionsRemovePullRequestBypassListForRepo.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() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.InteractionsRemovePullRequestBypassListForRepo.Output.NoContent) + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)/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.InteractionsRemovePullRequestBypassListForRepo.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.Forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.Forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/interaction-limits/pulls/bypass-list/delete(interactions/remove-pull-request-bypass-list-for-repo)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.ValidationFailed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.ValidationFailed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Get interaction restrictions for your public repositories /// /// Shows which type of GitHub user can interact with your public repositories and when the restriction expires.