diff --git a/Sources/apps/Client.swift b/Sources/apps/Client.swift index dfae4f8f131..5022336e307 100644 --- a/Sources/apps/Client.swift +++ b/Sources/apps/Client.swift @@ -383,13 +383,6 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "redelivery", - value: input.query.redelivery - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/apps/Types.swift b/Sources/apps/Types.swift index 7c320828b2e..5b43918dddd 100644 --- a/Sources/apps/Types.swift +++ b/Sources/apps/Types.swift @@ -5728,22 +5728,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/app/hook/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.cursor? - /// - Remark: Generated from `#/paths/app/hook/deliveries/GET/query/redelivery`. - public var redelivery: Swift.Bool? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - /// - redelivery: public init( per_page: Components.Parameters.per_hyphen_page? = nil, - cursor: Components.Parameters.cursor? = nil, - redelivery: Swift.Bool? = nil + cursor: Components.Parameters.cursor? = nil ) { self.per_page = per_page self.cursor = cursor - self.redelivery = redelivery } } public var query: Operations.apps_sol_list_hyphen_webhook_hyphen_deliveries.Input.Query diff --git a/Sources/checks/Types.swift b/Sources/checks/Types.swift index 65c72b9f68b..5a86e0e5cf2 100644 --- a/Sources/checks/Types.swift +++ b/Sources/checks/Types.swift @@ -2483,7 +2483,7 @@ public enum Components { /// - Remark: Generated from `#/components/schemas/check-suite`. public struct check_hyphen_suite: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/check-suite/id`. - public var id: Swift.Int + public var id: Swift.Int64 /// - Remark: Generated from `#/components/schemas/check-suite/node_id`. public var node_id: Swift.String /// - Remark: Generated from `#/components/schemas/check-suite/head_branch`. @@ -2571,7 +2571,7 @@ public enum Components { /// - rerequestable: /// - runs_rerequestable: public init( - id: Swift.Int, + id: Swift.Int64, node_id: Swift.String, head_branch: Swift.String? = nil, head_sha: Swift.String, diff --git a/Sources/code-scanning/Client.swift b/Sources/code-scanning/Client.swift index 288da633614..694f4025f5c 100644 --- a/Sources/code-scanning/Client.swift +++ b/Sources/code-scanning/Client.swift @@ -1493,7 +1493,7 @@ public struct Client: APIProtocol { /// /// Lists the CodeQL databases that are available in a repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -1632,7 +1632,7 @@ public struct Client: APIProtocol { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. @@ -1764,6 +1764,120 @@ public struct Client: APIProtocol { } ) } + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + public func code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database(_ input: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input) async throws -> Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output { + try await client.send( + input: input, + forOperation: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/repos/{}/{}/code-scanning/codeql/databases/{}", + parameters: [ + input.path.owner, + input.path.repo, + input.path.language + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.code_scanning_forbidden_write.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.service_unavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Responses.service_unavailable.Body.jsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. diff --git a/Sources/code-scanning/Types.swift b/Sources/code-scanning/Types.swift index 1f47dc564cc..ee84b6fa5d8 100644 --- a/Sources/code-scanning/Types.swift +++ b/Sources/code-scanning/Types.swift @@ -179,7 +179,7 @@ public protocol APIProtocol: Sendable { /// /// Lists the CodeQL databases that are available in a repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -194,11 +194,20 @@ public protocol APIProtocol: Sendable { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. func code_hyphen_scanning_sol_get_hyphen_codeql_hyphen_database(_ input: Operations.code_hyphen_scanning_sol_get_hyphen_codeql_hyphen_database.Input) async throws -> Operations.code_hyphen_scanning_sol_get_hyphen_codeql_hyphen_database.Output + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + func code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database(_ input: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input) async throws -> Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. @@ -545,7 +554,7 @@ extension APIProtocol { /// /// Lists the CodeQL databases that are available in a repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -568,7 +577,7 @@ extension APIProtocol { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. @@ -581,6 +590,23 @@ extension APIProtocol { headers: headers )) } + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + public func code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database( + path: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Path, + headers: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Headers = .init() + ) async throws -> Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output { + try await code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database(Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input( + path: path, + headers: headers + )) + } /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. @@ -5861,7 +5887,7 @@ public enum Operations { /// /// Lists the CodeQL databases that are available in a repository. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/get(code-scanning/list-codeql-databases)`. @@ -6079,7 +6105,7 @@ public enum Operations { /// your HTTP client is configured to follow redirects or use the `Location` header /// to make a second request to get the redirect URL. /// - /// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. /// /// - Remark: HTTP `GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/get(code-scanning/get-codeql-database)`. @@ -6317,6 +6343,201 @@ public enum Operations { } } } + /// Delete a CodeQL database + /// + /// Deletes a CodeQL database for a language in a repository. + /// + /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. + /// + /// - Remark: HTTP `DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}`. + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)`. + public enum code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database { + public static let id: Swift.String = "code-scanning/delete-codeql-database" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/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}/code-scanning/codeql/databases/{language}/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}/code-scanning/codeql/databases/{language}/DELETE/path/repo`. + public var repo: Components.Parameters.repo + /// The language of the CodeQL database. + /// + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/DELETE/path/language`. + public var language: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - owner: The account owner of the repository. The name is not case sensitive. + /// - repo: The name of the repository without the `.git` extension. The name is not case sensitive. + /// - language: The language of the CodeQL database. + public init( + owner: Components.Parameters.owner, + repo: Components.Parameters.repo, + language: Swift.String + ) { + self.owner = owner + self.repo = repo + self.language = language + } + } + public var path: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Path + /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/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.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Path, + headers: Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Response + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output.NoContent) + /// 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.code_hyphen_scanning_sol_delete_hyphen_codeql_hyphen_database.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + /// Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.code_scanning_forbidden_write) + /// 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.code_scanning_forbidden_write { + 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}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//repos/{owner}/{repo}/code-scanning/codeql/databases/{language}/delete(code-scanning/delete-codeql-database)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Components.Responses.service_unavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Components.Responses.service_unavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Create a CodeQL variant analysis /// /// Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. diff --git a/Sources/copilot/Client.swift b/Sources/copilot/Client.swift index 184dac7718b..4d43edfcdb4 100644 --- a/Sources/copilot/Client.swift +++ b/Sources/copilot/Client.swift @@ -223,32 +223,28 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for enterprise members - /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Get Copilot metrics for an enterprise /// - /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, - /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// The response contains metrics for up to 28 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. /// - /// Only owners and billing managers can view Copilot usage metrics for the enterprise. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.id, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/enterprises/{}/copilot/usage", + template: "/enterprises/{}/copilot/metrics", parameters: [ input.path.enterprise ] @@ -296,7 +292,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -306,7 +302,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self, + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day].self, from: responseBody, transforming: { value in .json(value) @@ -338,9 +334,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.requires_authentication.Body + let body: Components.Responses.forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -359,10 +355,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.forbidden.Body + let body: Components.Responses.not_found.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -381,10 +377,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.not_found.Body + let body: Components.Responses.usage_metrics_api_disabled.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -403,7 +399,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -416,38 +412,34 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for an enterprise team + /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. - /// See the response schema tab for detailed metrics definitions. + /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, + /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. /// /// The response contains metrics for up to 28 days prior. Usage 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. /// - /// > [!NOTE] - /// > This endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day. - /// - /// Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team. + /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-team)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, + forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.id, serializer: { input in let path = try converter.renderedPath( - template: "/enterprises/{}/team/{}/copilot/usage", + template: "/enterprises/{}/copilot/usage", parameters: [ - input.path.enterprise, - input.path.team_slug + input.path.enterprise ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -493,7 +485,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body + let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -613,30 +605,34 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot seat information and settings for an organization + /// Get Copilot metrics for an enterprise team /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// Gets information about an organization's Copilot subscription, including seat breakdown - /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. - /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". + /// The response contains metrics for up to 28 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. /// - /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/billing`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. - public func copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.id, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing", + template: "/enterprises/{}/team/{}/copilot/metrics", parameters: [ - input.path.org + input.path.enterprise, + input.path.team_slug ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -644,6 +640,34 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -654,7 +678,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output.Ok.Body + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -664,7 +688,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.copilot_hyphen_organization_hyphen_details.self, + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day].self, from: responseBody, transforming: { value in .json(value) @@ -696,9 +720,9 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .internalServerError(.init(body: body)) - case 401: + case 403: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.requires_authentication.Body + let body: Components.Responses.forbidden.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -717,10 +741,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .unauthorized(.init(body: body)) - case 403: + return .forbidden(.init(body: body)) + case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.forbidden.Body + let body: Components.Responses.not_found.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -739,10 +763,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .forbidden(.init(body: body)) - case 404: + return .notFound(.init(body: body)) + case 422: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Components.Responses.not_found.Body + let body: Components.Responses.usage_metrics_api_disabled.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -761,9 +785,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, @@ -776,27 +798,38 @@ public struct Client: APIProtocol { } ) } - /// List all Copilot seat assignments for an organization + /// Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. - /// Only organization owners can view assigned seats. + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for users within an enterprise team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// The response contains metrics for up to 28 days prior. Usage 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. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. - public func copilot_sol_list_hyphen_copilot_hyphen_seats(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output { + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day. + /// + /// Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/usage/get(copilot/usage-metrics-for-enterprise-team)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.id, + forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/seats", + template: "/enterprises/{}/team/{}/copilot/usage", parameters: [ - input.path.org + input.path.enterprise, + input.path.team_slug ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -804,6 +837,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "since", + value: input.query.since + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "until", + value: input.query.until + ) try converter.setQueryItemAsURI( in: &request, style: .form, @@ -827,13 +874,8 @@ public struct Client: APIProtocol { deserializer: { response, responseBody in switch response.status.code { case 200: - let headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Link", - as: Components.Headers.link.self - )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body + let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -843,7 +885,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body.jsonPayload.self, + [Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self, from: responseBody, transforming: { value in .json(value) @@ -852,10 +894,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .ok(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -956,62 +995,48 @@ public struct Client: APIProtocol { } ) } - /// Add teams to the Copilot subscription for an organization + /// Get Copilot seat information and settings for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Purchases a GitHub Copilot seat for all users within each specified team. - /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". - /// - /// Only organization owners can add Copilot seats for their organization members. - /// - /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. - /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". - /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". + /// Gets information about an organization's Copilot subscription, including seat breakdown + /// and feature policies. To configure these settings, go to your organization's settings on GitHub.com. + /// For more information, see "[Managing policies for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-copilot-business-in-your-organization)". /// - /// The response will contain the total number of new seats that were created and existing seats that were refreshed. + /// Only organization owners can view details about the organization's Copilot Business or Copilot Enterprise subscription. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. - public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/get(copilot/get-copilot-organization-details)`. + public func copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.id, + forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_teams", + template: "/orgs/{}/copilot/billing", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body + let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_organization_hyphen_details.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1021,7 +1046,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body.jsonPayload.self, + Components.Schemas.copilot_hyphen_organization_hyphen_details.self, from: responseBody, transforming: { value in .json(value) @@ -1030,7 +1055,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -1133,60 +1158,64 @@ public struct Client: APIProtocol { } ) } - /// Remove teams from the Copilot subscription for an organization + /// List all Copilot seat assignments for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for all members of each team specified. - /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. - /// - /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". - /// - /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". - /// - /// Only organization owners can cancel Copilot seats for their organization members. + /// Lists all active Copilot seats for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Only organization owners can view assigned seats. /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. - public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output { + /// - Remark: HTTP `GET /orgs/{org}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/seats/get(copilot/list-copilot-seats)`. + public func copilot_sol_list_hyphen_copilot_hyphen_seats(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.id, + forOperation: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_teams", + template: "/orgs/{}/copilot/billing/seats", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "page", + value: input.query.page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "per_page", + value: input.query.per_page + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: + let headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Headers = .init(Link: try converter.getOptionalHeaderFieldAsURI( + in: response.headerFields, + name: "Link", + as: Components.Headers.link.self + )) let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body + let body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1196,7 +1225,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body.jsonPayload.self, + Operations.copilot_sol_list_hyphen_copilot_hyphen_seats.Output.Ok.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1205,7 +1234,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .ok(.init( + headers: headers, + body: body + )) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -1294,8 +1326,6 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) - case 422: - return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1308,12 +1338,12 @@ public struct Client: APIProtocol { } ) } - /// Add users to the Copilot subscription for an organization + /// Add teams to the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Purchases a GitHub Copilot seat for each user specified. + /// Purchases a GitHub Copilot seat for all users within each specified team. /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". /// /// Only organization owners can add Copilot seats for their organization members. @@ -1326,15 +1356,15 @@ public struct Client: APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// - /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. - public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output { + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/post(copilot/add-copilot-seats-for-teams)`. + public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.id, + forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_users", + template: "/orgs/{}/copilot/billing/selected_teams", parameters: [ input.path.org ] @@ -1363,7 +1393,7 @@ public struct Client: APIProtocol { switch response.status.code { case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body + let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1373,7 +1403,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body.jsonPayload.self, + Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_teams.Output.Created.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1485,13 +1515,13 @@ public struct Client: APIProtocol { } ) } - /// Remove users from the Copilot subscription for an organization + /// Remove teams from the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Cancels the Copilot seat assignment for each user specified. - /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. + /// Cancels the Copilot seat assignment for all members of each team specified. + /// This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. /// /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". /// @@ -1501,15 +1531,15 @@ public struct Client: APIProtocol { /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. /// - /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. - public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output { + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_teams`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_teams/delete(copilot/cancel-copilot-seat-assignment-for-teams)`. + public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.id, + forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/billing/selected_users", + template: "/orgs/{}/copilot/billing/selected_teams", parameters: [ input.path.org ] @@ -1538,7 +1568,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body + let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1548,7 +1578,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body.jsonPayload.self, + Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_teams.Output.Ok.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1660,80 +1690,62 @@ public struct Client: APIProtocol { } ) } - /// Get a summary of Copilot usage for organization members + /// Add users to the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. - /// See the response schema tab for detailed metrics definitions. + /// Purchases a GitHub Copilot seat for each user specified. + /// The organization will be billed accordingly. For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". /// - /// The response contains metrics for up to 28 days prior. Usage 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. + /// Only organization owners can add Copilot seats for their organization members. /// - /// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics. + /// In order for an admin to use this endpoint, the organization must have a Copilot Business or Enterprise subscription and a configured suggestion matching policy. + /// For more information about setting up a Copilot subscription, see "[Setting up a Copilot subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise)". + /// For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-policies-for-github-copilot-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint. + /// The response will contain the total number of new seats that were created and existing seats that were refreshed. /// - /// - Remark: HTTP `GET /orgs/{org}/copilot/usage`. - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`. - public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output { + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `POST /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/post(copilot/add-copilot-seats-for-users)`. + public func copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.id, + forOperation: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/copilot/usage", + template: "/orgs/{}/copilot/billing/selected_users", parameters: [ input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "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.per_page - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output.Ok.Body + let body: Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1743,7 +1755,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.copilot_hyphen_usage_hyphen_metrics].self, + Operations.copilot_sol_add_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_users.Output.Created.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -1752,7 +1764,7 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) let body: Components.Responses.internal_error.Body @@ -1841,6 +1853,8 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) default: return .undocumented( statusCode: response.status.code, @@ -1853,47 +1867,60 @@ public struct Client: APIProtocol { } ) } - /// Get Copilot seat assignment details for a user + /// Remove users from the Copilot subscription for an organization /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// Cancels the Copilot seat assignment for each user specified. + /// This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. /// - /// Only organization owners can view Copilot seat assignment details for members of their organization. + /// For more information about Copilot pricing, see "[Pricing for GitHub Copilot](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot)". /// - /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// For more information about disabling access to Copilot Business or Enterprise, see "[Revoking access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/managing-copilot/managing-access-for-copilot-in-your-organization#revoking-access-to-github-copilot-for-specific-users-in-your-organization)". /// - /// - 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)`. - public func copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output { + /// Only organization owners can cancel Copilot seats for their organization members. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `admin:org` scopes to use this endpoint. + /// + /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. + public func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output { try await client.send( input: input, - forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.id, + forOperation: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.id, serializer: { input in let path = try converter.renderedPath( - template: "/orgs/{}/members/{}/copilot", + template: "/orgs/{}/copilot/billing/selected_users", parameters: [ - input.path.org, - input.path.username + input.path.org ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output.Ok.Body + let body: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -1903,7 +1930,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.copilot_hyphen_seat_hyphen_details.self, + Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.Ok.Body.jsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -2015,6 +2042,746 @@ 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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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.copilot_hyphen_usage_hyphen_metrics_hyphen_day].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.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .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.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.usage_metrics_api_disabled.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get a summary of Copilot usage for organization members + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// across an organization, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day. + /// See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 days prior. Usage 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. + /// + /// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage 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/usage`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`. + public func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/copilot/usage", + parameters: [ + input.path.org + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "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.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_org.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.copilot_hyphen_usage_hyphen_metrics].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.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.requires_authentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get Copilot seat assignment details for a user + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Gets the GitHub Copilot seat assignment details for a member of an organization who currently has access to GitHub Copilot. + /// + /// Only organization owners can view Copilot seat assignment details for members of their organization. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:org` scopes to use this endpoint. + /// + /// - 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)`. + public func copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/members/{}/copilot", + parameters: [ + input.path.org, + input.path.username + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.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.copilot_hyphen_seat_hyphen_details.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.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.requires_authentication.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 403: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.forbidden.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + return .unprocessableContent(.init()) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// 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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output { + try await client.send( + input: input, + forOperation: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/team/{}/copilot/metrics", + parameters: [ + input.path.org, + input.path.team_slug + ] + ) + 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.per_page + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.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.copilot_hyphen_usage_hyphen_metrics_hyphen_day].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.internal_error.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .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.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .forbidden(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.not_found.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.usage_metrics_api_disabled.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.basic_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// Get a summary of Copilot usage for a team /// /// > [!NOTE] diff --git a/Sources/copilot/Types.swift b/Sources/copilot/Types.swift index e2f9fd058be..884622db1f0 100644 --- a/Sources/copilot/Types.swift +++ b/Sources/copilot/Types.swift @@ -29,6 +29,22 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. func copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output + /// Get Copilot metrics for an enterprise + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 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 or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] @@ -49,6 +65,25 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. func copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise(_ input: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input) async throws -> Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output + /// Get Copilot metrics for an enterprise 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. + /// + /// The response contains metrics for up to 28 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. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output /// Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] @@ -181,6 +216,25 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /orgs/{org}/copilot/billing/selected_users`. /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)`. func copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users(_ input: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Input) async throws -> Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output /// Get a summary of Copilot usage for organization members /// /// > [!NOTE] @@ -215,6 +269,25 @@ 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 copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user(_ input: Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.Input) async throws -> Operations.copilot_sol_get_hyphen_copilot_hyphen_seat_hyphen_details_hyphen_for_hyphen_user.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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team(_ input: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output /// Get a summary of Copilot usage for a team /// /// > [!NOTE] @@ -270,6 +343,32 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot metrics for an enterprise + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 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 or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] @@ -300,6 +399,35 @@ extension APIProtocol { headers: headers )) } + /// Get Copilot metrics for an enterprise 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. + /// + /// The response contains metrics for up to 28 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. + /// + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + public func copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for an enterprise team /// /// > [!NOTE] @@ -500,6 +628,35 @@ 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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for organization members /// /// > [!NOTE] @@ -552,6 +709,35 @@ 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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers = .init() + ) async throws -> Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output { + try await copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input( + path: path, + query: query, + headers: headers + )) + } /// Get a summary of Copilot usage for a team /// /// > [!NOTE] @@ -1362,734 +1548,2235 @@ public enum Components { ]) } } - /// Summary of Copilot usage. + /// Usage metrics for Copilot editor code completions in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics`. - public struct copilot_hyphen_usage_hyphen_metrics: Codable, Hashable, Sendable { - /// The date for which the usage metrics are reported, in `YYYY-MM-DD` format. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/day`. - public var day: Swift.String - /// The total number of Copilot code completion suggestions shown to users. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_suggestions_count`. - public var total_suggestions_count: Swift.Int? - /// The total number of Copilot code completion suggestions accepted by users. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_acceptances_count`. - public var total_acceptances_count: Swift.Int? - /// The total number of lines of code completions suggested by Copilot. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_suggested`. - public var total_lines_suggested: Swift.Int? - /// The total number of lines of code completions accepted by users. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_accepted`. - public var total_lines_accepted: Swift.Int? - /// The total number of users who were shown Copilot code completion suggestions during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_users`. - public var total_active_users: Swift.Int? - /// The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_acceptances`. - public var total_chat_acceptances: Swift.Int? - /// The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions`. + public struct copilot_hyphen_ide_hyphen_code_hyphen_completions: 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-usage-metrics/total_chat_turns`. - public var total_chat_turns: Swift.Int? - /// The total number of users who interacted with Copilot Chat in the IDE during the day specified. - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_chat_users`. - public var total_active_chat_users: Swift.Int? - /// Breakdown of Copilot usage by editor for this language + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Usage metrics for a given language for the given editor for Copilot code completions. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload`. - public struct breakdownPayloadPayload: Codable, Hashable, Sendable { - /// The language in which Copilot suggestions were shown to users in the specified editor. + /// - 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-usage-metrics/breakdownPayload/language`. - public var language: Swift.String? - /// The editor in which Copilot suggestions were shown to users for the specified language. + /// - 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-usage-metrics/breakdownPayload/editor`. - public var editor: Swift.String? - /// The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languagesPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Creates a new `languagesPayloadPayload`. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/suggestions_count`. - public var suggestions_count: Swift.Int? - /// The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions. + /// - total_engaged_users: 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, + total_engaged_users: Swift.Int? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + } + } + /// Code completion metrics for active languages. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. + public typealias languagesPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayloadPayload] + /// Code completion metrics for active languages. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/languages`. + public var languages: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.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-usage-metrics/breakdownPayload/acceptances_count`. - public var acceptances_count: Swift.Int? - /// The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// - 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/schemas/copilot-usage-metrics/breakdownPayload/lines_suggested`. - public var lines_suggested: Swift.Int? - /// The number of lines of code accepted by users in the editor specified during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/modelsPayload`. + public struct modelsPayloadPayload: 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/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 is_custom_model: 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 custom_model_training_date: 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 total_engaged_users: 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 total_engaged_users: 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 total_code_suggestions: 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 total_code_acceptances: 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 total_code_lines_suggested: 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 total_code_lines_accepted: Swift.Int? + /// Creates a new `languagesPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. + /// - total_engaged_users: 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. + /// - total_code_suggestions: The number of Copilot code suggestions generated for the given editor, for the given language. + /// - total_code_acceptances: The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances. + /// - total_code_lines_suggested: The number of lines of code suggested by Copilot code completions for the given editor, for the given language. + /// - total_code_lines_accepted: 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, + total_engaged_users: Swift.Int? = nil, + total_code_suggestions: Swift.Int? = nil, + total_code_acceptances: Swift.Int? = nil, + total_code_lines_suggested: Swift.Int? = nil, + total_code_lines_accepted: Swift.Int? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + self.total_code_suggestions = total_code_suggestions + self.total_code_acceptances = total_code_acceptances + self.total_code_lines_suggested = total_code_lines_suggested + self.total_code_lines_accepted = total_code_lines_accepted + } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case total_code_suggestions + case total_code_acceptances + case total_code_lines_suggested + case total_code_lines_accepted + } + } + /// 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.copilot_hyphen_ide_hyphen_code_hyphen_completions.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.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayloadPayload.languagesPayload? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model. + /// - total_engaged_users: 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, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + languages: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayloadPayload.languagesPayload? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_engaged_users = total_engaged_users + self.languages = languages + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_engaged_users + case languages + } + } + /// List of model metrics for custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_accepted`. - public var lines_accepted: Swift.Int? - /// The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/models`. + public typealias modelsPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayloadPayload] + /// List of model metrics for custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/active_users`. - public var active_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editorsPayload/models`. + public var models: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload? /// A container of undocumented properties. public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `breakdownPayloadPayload`. + /// Creates a new `editorsPayloadPayload`. /// /// - Parameters: - /// - language: The language in which Copilot suggestions were shown to users in the specified editor. - /// - editor: The editor in which Copilot suggestions were shown to users for the specified language. - /// - suggestions_count: The number of Copilot suggestions shown to users in the editor specified during the day specified. - /// - acceptances_count: The number of Copilot suggestions accepted by users in the editor specified during the day specified. - /// - lines_suggested: The number of lines of code suggested by Copilot in the editor specified during the day specified. - /// - lines_accepted: The number of lines of code accepted by users in the editor specified during the day specified. - /// - active_users: The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// - name: Name of the given editor. + /// - total_engaged_users: 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( - language: Swift.String? = nil, - editor: Swift.String? = nil, - suggestions_count: Swift.Int? = nil, - acceptances_count: Swift.Int? = nil, - lines_suggested: Swift.Int? = nil, - lines_accepted: Swift.Int? = nil, - active_users: Swift.Int? = nil, + name: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload? = nil, additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.language = language - self.editor = editor - self.suggestions_count = suggestions_count - self.acceptances_count = acceptances_count - self.lines_suggested = lines_suggested - self.lines_accepted = lines_accepted - self.active_users = active_users + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case language - case editor - case suggestions_count - case acceptances_count - case lines_suggested - case lines_accepted - case active_users + case name + case total_engaged_users + case models } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - language = try container.decodeIfPresent( - Swift.String.self, - forKey: .language - ) - editor = try container.decodeIfPresent( + name = try container.decodeIfPresent( Swift.String.self, - forKey: .editor - ) - suggestions_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .suggestions_count - ) - acceptances_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .acceptances_count - ) - lines_suggested = try container.decodeIfPresent( - Swift.Int.self, - forKey: .lines_suggested + forKey: .name ) - lines_accepted = try container.decodeIfPresent( + total_engaged_users = try container.decodeIfPresent( Swift.Int.self, - forKey: .lines_accepted + forKey: .total_engaged_users ) - active_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .active_users + models = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload.modelsPayload.self, + forKey: .models ) additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "language", - "editor", - "suggestions_count", - "acceptances_count", - "lines_suggested", - "lines_accepted", - "active_users" + "name", + "total_engaged_users", + "models" ]) } public func encode(to encoder: any Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent( - language, - forKey: .language + name, + forKey: .name ) try container.encodeIfPresent( - editor, - forKey: .editor - ) - try container.encodeIfPresent( - suggestions_count, - forKey: .suggestions_count - ) - try container.encodeIfPresent( - acceptances_count, - forKey: .acceptances_count - ) - try container.encodeIfPresent( - lines_suggested, - forKey: .lines_suggested - ) - try container.encodeIfPresent( - lines_accepted, - forKey: .lines_accepted + total_engaged_users, + forKey: .total_engaged_users ) try container.encodeIfPresent( - active_users, - forKey: .active_users + models, + forKey: .models ) try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Breakdown of Copilot code completions usage by language and editor - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. - public typealias breakdownPayload = [Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayloadPayload] - /// Breakdown of Copilot code completions usage by language and editor - /// - /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. - public var breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? - /// Creates a new `copilot_hyphen_usage_hyphen_metrics`. + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. + public typealias editorsPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/copilot-ide-code-completions/editors`. + public var editors: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_ide_hyphen_code_hyphen_completions`. /// /// - Parameters: - /// - day: The date for which the usage metrics are reported, in `YYYY-MM-DD` format. - /// - total_suggestions_count: The total number of Copilot code completion suggestions shown to users. - /// - total_acceptances_count: The total number of Copilot code completion suggestions accepted by users. - /// - total_lines_suggested: The total number of lines of code completions suggested by Copilot. - /// - total_lines_accepted: The total number of lines of code completions accepted by users. - /// - total_active_users: The total number of users who were shown Copilot code completion suggestions during the day specified. - /// - total_chat_acceptances: The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). - /// - total_chat_turns: The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. - /// - total_active_chat_users: The total number of users who interacted with Copilot Chat in the IDE during the day specified. - /// - breakdown: Breakdown of Copilot code completions usage by language and editor + /// - total_engaged_users: 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( - day: Swift.String, - total_suggestions_count: Swift.Int? = nil, - total_acceptances_count: Swift.Int? = nil, - total_lines_suggested: Swift.Int? = nil, - total_lines_accepted: Swift.Int? = nil, - total_active_users: Swift.Int? = nil, - total_chat_acceptances: Swift.Int? = nil, - total_chat_turns: Swift.Int? = nil, - total_active_chat_users: Swift.Int? = nil, - breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? = nil + total_engaged_users: Swift.Int? = nil, + languages: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayload? = nil, + editors: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.day = day - self.total_suggestions_count = total_suggestions_count - self.total_acceptances_count = total_acceptances_count - self.total_lines_suggested = total_lines_suggested - self.total_lines_accepted = total_lines_accepted - self.total_active_users = total_active_users - self.total_chat_acceptances = total_chat_acceptances - self.total_chat_turns = total_chat_turns - self.total_active_chat_users = total_active_chat_users - self.breakdown = breakdown + self.total_engaged_users = total_engaged_users + self.languages = languages + self.editors = editors + self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case day - case total_suggestions_count - case total_acceptances_count - case total_lines_suggested - case total_lines_accepted - case total_active_users - case total_chat_acceptances - case total_chat_turns - case total_active_chat_users - case breakdown + case total_engaged_users + case languages + case editors } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - day = try container.decode( - Swift.String.self, - forKey: .day - ) - total_suggestions_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_suggestions_count - ) - total_acceptances_count = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_acceptances_count - ) - total_lines_suggested = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_lines_suggested - ) - total_lines_accepted = try container.decodeIfPresent( + total_engaged_users = try container.decodeIfPresent( Swift.Int.self, - forKey: .total_lines_accepted + forKey: .total_engaged_users ) - total_active_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_active_users + languages = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.languagesPayload.self, + forKey: .languages ) - total_chat_acceptances = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_chat_acceptances + editors = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.editorsPayload.self, + forKey: .editors ) - total_chat_turns = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_chat_turns + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "languages", + "editors" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users ) - total_active_chat_users = try container.decodeIfPresent( - Swift.Int.self, - forKey: .total_active_chat_users + try container.encodeIfPresent( + languages, + forKey: .languages ) - breakdown = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload.self, - forKey: .breakdown + try container.encodeIfPresent( + editors, + forKey: .editors ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "day", - "total_suggestions_count", - "total_acceptances_count", - "total_lines_suggested", - "total_lines_accepted", - "total_active_users", - "total_chat_acceptances", - "total_chat_turns", - "total_active_chat_users", - "breakdown" - ]) + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// The breakdown of Copilot Business seats for the organization. + /// Usage metrics for Copilot Chat in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown`. - public struct copilot_hyphen_seat_hyphen_breakdown: Codable, Hashable, Sendable { - /// The total number of seats being billed for the organization as of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/total`. - public var total: Swift.Int? - /// Seats added during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/added_this_cycle`. - public var added_this_cycle: Swift.Int? - /// The number of seats that are pending cancellation at the end of the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_cancellation`. - public var pending_cancellation: Swift.Int? - /// The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat`. + public struct copilot_hyphen_ide_hyphen_chat: Codable, Hashable, Sendable { + /// Total number of users who prompted Copilot Chat in the IDE. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_invitation`. - public var pending_invitation: Swift.Int? - /// The number of seats that have used Copilot during the current billing cycle. - /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/active_this_cycle`. - public var active_this_cycle: Swift.Int? - /// The number of seats that have not used Copilot during the current billing cycle. + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// Copilot Chat metrics, for active editors. /// - /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/inactive_this_cycle`. - public var inactive_this_cycle: Swift.Int? - /// Creates a new `copilot_hyphen_seat_hyphen_breakdown`. + /// - 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. + /// + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/total_engaged_users`. + public var total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editorsPayload/modelsPayload`. + public struct modelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + /// + /// - 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 is_custom_model: 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 custom_model_training_date: 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 total_engaged_users: 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 total_chats: 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 total_chat_insertion_events: 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 total_chat_copy_events: Swift.Int? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model. + /// - total_engaged_users: The number of users who prompted Copilot Chat in the given editor and model. + /// - total_chats: The total number of chats initiated by users in the given editor and model. + /// - total_chat_insertion_events: The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor. + /// - total_chat_copy_events: 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, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + total_chats: Swift.Int? = nil, + total_chat_insertion_events: Swift.Int? = nil, + total_chat_copy_events: Swift.Int? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_engaged_users = total_engaged_users + self.total_chats = total_chats + self.total_chat_insertion_events = total_chat_insertion_events + self.total_chat_copy_events = total_chat_copy_events + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_engaged_users + case total_chats + case total_chat_insertion_events + case total_chat_copy_events + } + } + /// 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.copilot_hyphen_ide_hyphen_chat.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.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload.modelsPayload? + /// Creates a new `editorsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the given editor. + /// - total_engaged_users: 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, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload.modelsPayload? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models + } + public enum CodingKeys: String, CodingKey { + case name + case total_engaged_users + case models + } + } + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. + public typealias editorsPayload = [Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayloadPayload] + /// - Remark: Generated from `#/components/schemas/copilot-ide-chat/editors`. + public var editors: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_ide_hyphen_chat`. /// /// - Parameters: - /// - total: The total number of seats being billed for the organization as of the current billing cycle. - /// - added_this_cycle: Seats added during the current billing cycle. - /// - pending_cancellation: The number of seats that are pending cancellation at the end of the current billing cycle. - /// - pending_invitation: The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. - /// - active_this_cycle: The number of seats that have used Copilot during the current billing cycle. - /// - inactive_this_cycle: The number of seats that have not used Copilot during the current billing cycle. + /// - total_engaged_users: Total number of users who prompted Copilot Chat in the IDE. + /// - editors: + /// - additionalProperties: A container of undocumented properties. public init( - total: Swift.Int? = nil, - added_this_cycle: Swift.Int? = nil, - pending_cancellation: Swift.Int? = nil, - pending_invitation: Swift.Int? = nil, - active_this_cycle: Swift.Int? = nil, - inactive_this_cycle: Swift.Int? = nil + total_engaged_users: Swift.Int? = nil, + editors: Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.total = total - self.added_this_cycle = added_this_cycle - self.pending_cancellation = pending_cancellation - self.pending_invitation = pending_invitation - self.active_this_cycle = active_this_cycle - self.inactive_this_cycle = inactive_this_cycle + self.total_engaged_users = total_engaged_users + self.editors = editors + self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case total - case added_this_cycle - case pending_cancellation - case pending_invitation - case active_this_cycle - case inactive_this_cycle + case total_engaged_users + case editors + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + editors = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_chat.editorsPayload.self, + forKey: .editors + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "editors" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + editors, + forKey: .editors + ) + try encoder.encodeAdditionalProperties(additionalProperties) } } - /// Information about the seat breakdown and policies set for an organization with a Copilot Business or Copilot Enterprise subscription. + /// Usage metrics for Copilot Chat in github.com /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. - public struct copilot_hyphen_organization_hyphen_details: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. - public var seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown - /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - @frozen public enum public_code_suggestionsPayload: String, Codable, Hashable, Sendable { - case allow = "allow" - case block = "block" - case unconfigured = "unconfigured" - case unknown = "unknown" + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat`. + public struct copilot_hyphen_dotcom_hyphen_chat: 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 total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/modelsPayload`. + public struct modelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + /// + /// - 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 is_custom_model: 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 custom_model_training_date: 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 total_engaged_users: 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 total_chats: Swift.Int? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model (if applicable). + /// - total_engaged_users: Total number of users who prompted Copilot Chat on github.com at least once for each model. + /// - total_chats: Total number of chats initiated by users on github.com. + public init( + name: Swift.String? = nil, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_engaged_users: Swift.Int? = nil, + total_chats: Swift.Int? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_engaged_users = total_engaged_users + self.total_chats = total_chats + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_engaged_users + case total_chats + } } - /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// List of model metrics for a custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. - public var public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload - /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. + public typealias modelsPayload = [Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayloadPayload] + /// List of model metrics for a custom models and the default model. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - @frozen public enum ide_chatPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" - } - /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. - public var ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? - /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-chat/models`. + public var models: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_dotcom_hyphen_chat`. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - @frozen public enum platform_chatPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + /// - Parameters: + /// - total_engaged_users: 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( + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.total_engaged_users = total_engaged_users + self.models = models + self.additionalProperties = additionalProperties } - /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. - public var platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? - /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - @frozen public enum cliPayload: String, Codable, Hashable, Sendable { - case enabled = "enabled" - case disabled = "disabled" - case unconfigured = "unconfigured" + public enum CodingKeys: String, CodingKey { + case total_engaged_users + case models } - /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. - public var cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? - /// The mode of assigning new seats. - /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. - @frozen public enum seat_management_settingPayload: String, Codable, Hashable, Sendable { - case assign_all = "assign_all" - case assign_selected = "assign_selected" - case disabled = "disabled" - case unconfigured = "unconfigured" + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + models = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.modelsPayload.self, + forKey: .models + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "models" + ]) } - /// The mode of assigning new seats. + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + 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 copilot_hyphen_dotcom_hyphen_pull_hyphen_requests: 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 total_engaged_users: 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 total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositoriesPayload/modelsPayload`. + public struct modelsPayloadPayload: Codable, Hashable, Sendable { + /// Name of the language used for Copilot code completion suggestions, for the given editor. + /// + /// - 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 is_custom_model: 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 custom_model_training_date: 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 total_pr_summaries_created: 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 total_engaged_users: Swift.Int? + /// Creates a new `modelsPayloadPayload`. + /// + /// - Parameters: + /// - name: Name of the language used for Copilot code completion suggestions, for the given editor. + /// - is_custom_model: Indicates whether a model is custom or default. + /// - custom_model_training_date: The training date for the custom model. + /// - total_pr_summaries_created: The number of pull request summaries generated using Copilot for Pull Requests in the given repository. + /// - total_engaged_users: 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, + is_custom_model: Swift.Bool? = nil, + custom_model_training_date: Swift.String? = nil, + total_pr_summaries_created: Swift.Int? = nil, + total_engaged_users: Swift.Int? = nil + ) { + self.name = name + self.is_custom_model = is_custom_model + self.custom_model_training_date = custom_model_training_date + self.total_pr_summaries_created = total_pr_summaries_created + self.total_engaged_users = total_engaged_users + } + public enum CodingKeys: String, CodingKey { + case name + case is_custom_model + case custom_model_training_date + case total_pr_summaries_created + case 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.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.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.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload.modelsPayload? + /// Creates a new `repositoriesPayloadPayload`. + /// + /// - Parameters: + /// - name: Repository name + /// - total_engaged_users: 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, + total_engaged_users: Swift.Int? = nil, + models: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload.modelsPayload? = nil + ) { + self.name = name + self.total_engaged_users = total_engaged_users + self.models = models + } + public enum CodingKeys: String, CodingKey { + case name + case 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-organization-details/seat_management_setting`. - public var seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload - /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. + public typealias repositoriesPayload = [Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayloadPayload] + /// Repositories in which users used Copilot for Pull Requests to generate pull request summaries /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. - @frozen public enum plan_typePayload: String, Codable, Hashable, Sendable { - case business = "business" - case enterprise = "enterprise" - case unknown = "unknown" + /// - Remark: Generated from `#/components/schemas/copilot-dotcom-pull-requests/repositories`. + public var repositories: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_dotcom_hyphen_pull_hyphen_requests`. + /// + /// - Parameters: + /// - total_engaged_users: 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( + total_engaged_users: Swift.Int? = nil, + repositories: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.total_engaged_users = total_engaged_users + self.repositories = repositories + self.additionalProperties = additionalProperties } - /// The Copilot plan of the organization, or the parent enterprise, when applicable. + public enum CodingKeys: String, CodingKey { + case total_engaged_users + case repositories + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users + ) + repositories = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.repositoriesPayload.self, + forKey: .repositories + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "total_engaged_users", + "repositories" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + total_engaged_users, + forKey: .total_engaged_users + ) + try container.encodeIfPresent( + 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 copilot_hyphen_usage_hyphen_metrics_hyphen_day: Codable, Hashable, Sendable { + /// The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. /// - /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. - public var plan_type: Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload? + /// - 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 total_active_users: 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 total_engaged_users: Swift.Int? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_code_completions`. + public var copilot_ide_code_completions: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_ide_chat`. + public var copilot_ide_chat: Components.Schemas.copilot_hyphen_ide_hyphen_chat? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_chat`. + public var copilot_dotcom_chat: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat? + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics-day/copilot_dotcom_pull_requests`. + public var copilot_dotcom_pull_requests: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests? /// A container of undocumented properties. public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `copilot_hyphen_organization_hyphen_details`. + /// Creates a new `copilot_hyphen_usage_hyphen_metrics_hyphen_day`. /// /// - Parameters: - /// - seat_breakdown: - /// - public_code_suggestions: The organization policy for allowing or disallowing Copilot to make suggestions that match public code. - /// - ide_chat: The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. - /// - platform_chat: The organization policy for allowing or disallowing organization members to use Copilot features within github.com. - /// - cli: The organization policy for allowing or disallowing organization members to use Copilot within their CLI. - /// - seat_management_setting: The mode of assigning new seats. - /// - plan_type: The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - date: The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format. + /// - total_active_users: 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. + /// - total_engaged_users: 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. + /// - copilot_ide_code_completions: + /// - copilot_ide_chat: + /// - copilot_dotcom_chat: + /// - copilot_dotcom_pull_requests: /// - additionalProperties: A container of undocumented properties. public init( - seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown, - public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload, - ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? = nil, - platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? = nil, - cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? = nil, - seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload, - plan_type: Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload? = nil, + date: Swift.String, + total_active_users: Swift.Int? = nil, + total_engaged_users: Swift.Int? = nil, + copilot_ide_code_completions: Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions? = nil, + copilot_ide_chat: Components.Schemas.copilot_hyphen_ide_hyphen_chat? = nil, + copilot_dotcom_chat: Components.Schemas.copilot_hyphen_dotcom_hyphen_chat? = nil, + copilot_dotcom_pull_requests: Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests? = nil, additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.seat_breakdown = seat_breakdown - self.public_code_suggestions = public_code_suggestions - self.ide_chat = ide_chat - self.platform_chat = platform_chat - self.cli = cli - self.seat_management_setting = seat_management_setting - self.plan_type = plan_type + self.date = date + self.total_active_users = total_active_users + self.total_engaged_users = total_engaged_users + self.copilot_ide_code_completions = copilot_ide_code_completions + self.copilot_ide_chat = copilot_ide_chat + self.copilot_dotcom_chat = copilot_dotcom_chat + self.copilot_dotcom_pull_requests = copilot_dotcom_pull_requests self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case seat_breakdown - case public_code_suggestions - case ide_chat - case platform_chat - case cli - case seat_management_setting - case plan_type + case date + case total_active_users + case total_engaged_users + case copilot_ide_code_completions + case copilot_ide_chat + case copilot_dotcom_chat + case copilot_dotcom_pull_requests } public init(from decoder: any Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - seat_breakdown = try container.decode( - Components.Schemas.copilot_hyphen_seat_hyphen_breakdown.self, - forKey: .seat_breakdown + date = try container.decode( + Swift.String.self, + forKey: .date ) - public_code_suggestions = try container.decode( - Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload.self, - forKey: .public_code_suggestions + total_active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_users ) - ide_chat = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload.self, - forKey: .ide_chat + total_engaged_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_engaged_users ) - platform_chat = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload.self, - forKey: .platform_chat + copilot_ide_code_completions = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_code_hyphen_completions.self, + forKey: .copilot_ide_code_completions ) - cli = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload.self, - forKey: .cli + copilot_ide_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_ide_hyphen_chat.self, + forKey: .copilot_ide_chat ) - seat_management_setting = try container.decode( - Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload.self, - forKey: .seat_management_setting + copilot_dotcom_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_chat.self, + forKey: .copilot_dotcom_chat ) - plan_type = try container.decodeIfPresent( - Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload.self, - forKey: .plan_type + copilot_dotcom_pull_requests = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_dotcom_hyphen_pull_hyphen_requests.self, + forKey: .copilot_dotcom_pull_requests ) additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "seat_breakdown", - "public_code_suggestions", - "ide_chat", - "platform_chat", - "cli", - "seat_management_setting", - "plan_type" + "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 Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode( - seat_breakdown, - forKey: .seat_breakdown + date, + forKey: .date ) - try container.encode( - public_code_suggestions, - forKey: .public_code_suggestions + try container.encodeIfPresent( + total_active_users, + forKey: .total_active_users ) try container.encodeIfPresent( - ide_chat, - forKey: .ide_chat + total_engaged_users, + forKey: .total_engaged_users ) try container.encodeIfPresent( - platform_chat, - forKey: .platform_chat + copilot_ide_code_completions, + forKey: .copilot_ide_code_completions ) try container.encodeIfPresent( - cli, - forKey: .cli + copilot_ide_chat, + forKey: .copilot_ide_chat ) - try container.encode( - seat_management_setting, - forKey: .seat_management_setting + try container.encodeIfPresent( + copilot_dotcom_chat, + forKey: .copilot_dotcom_chat ) try container.encodeIfPresent( - plan_type, - forKey: .plan_type + copilot_dotcom_pull_requests, + forKey: .copilot_dotcom_pull_requests ) try encoder.encodeAdditionalProperties(additionalProperties) } } - } - /// Types generated from the `#/components/parameters` section of the OpenAPI document. - public enum Parameters { - /// 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. You can also substitute this value with the enterprise id. - /// - /// - Remark: Generated from `#/components/parameters/enterprise`. - public typealias enterprise = Swift.String - /// The slug of the team name. - /// - /// - Remark: Generated from `#/components/parameters/team-slug`. - public typealias team_hyphen_slug = Swift.String - /// The organization name. The name is not case sensitive. - /// - /// - Remark: Generated from `#/components/parameters/org`. - public typealias org = Swift.String - /// The handle for the GitHub user account. + /// Summary of Copilot usage. /// - /// - Remark: Generated from `#/components/parameters/username`. - public typealias username = Swift.String - } - /// Types generated from the `#/components/requestBodies` section of the OpenAPI document. - public enum RequestBodies {} - /// Types generated from the `#/components/responses` section of the OpenAPI document. - public enum Responses { - public struct not_found: 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.basic_hyphen_error) - /// 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.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics`. + public struct copilot_hyphen_usage_hyphen_metrics: Codable, Hashable, Sendable { + /// The date for which the usage metrics are reported, in `YYYY-MM-DD` format. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/day`. + public var day: Swift.String + /// The total number of Copilot code completion suggestions shown to users. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_suggestions_count`. + public var total_suggestions_count: Swift.Int? + /// The total number of Copilot code completion suggestions accepted by users. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_acceptances_count`. + public var total_acceptances_count: Swift.Int? + /// The total number of lines of code completions suggested by Copilot. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_suggested`. + public var total_lines_suggested: Swift.Int? + /// The total number of lines of code completions accepted by users. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_lines_accepted`. + public var total_lines_accepted: Swift.Int? + /// The total number of users who were shown Copilot code completion suggestions during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_users`. + public var total_active_users: Swift.Int? + /// The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_acceptances`. + public var total_chat_acceptances: Swift.Int? + /// The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_chat_turns`. + public var total_chat_turns: Swift.Int? + /// The total number of users who interacted with Copilot Chat in the IDE during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/total_active_chat_users`. + public var total_active_chat_users: Swift.Int? + /// Breakdown of Copilot usage by editor for this language + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload`. + public struct breakdownPayloadPayload: Codable, Hashable, Sendable { + /// The language in which Copilot suggestions were shown to users in the specified editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/language`. + public var language: Swift.String? + /// The editor in which Copilot suggestions were shown to users for the specified language. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/editor`. + public var editor: Swift.String? + /// The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/suggestions_count`. + public var suggestions_count: Swift.Int? + /// The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/acceptances_count`. + public var acceptances_count: Swift.Int? + /// The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_suggested`. + public var lines_suggested: Swift.Int? + /// The number of lines of code accepted by users in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/lines_accepted`. + public var lines_accepted: Swift.Int? + /// The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdownPayload/active_users`. + public var active_users: Swift.Int? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `breakdownPayloadPayload`. + /// + /// - Parameters: + /// - language: The language in which Copilot suggestions were shown to users in the specified editor. + /// - editor: The editor in which Copilot suggestions were shown to users for the specified language. + /// - suggestions_count: The number of Copilot suggestions shown to users in the editor specified during the day specified. + /// - acceptances_count: The number of Copilot suggestions accepted by users in the editor specified during the day specified. + /// - lines_suggested: The number of lines of code suggested by Copilot in the editor specified during the day specified. + /// - lines_accepted: The number of lines of code accepted by users in the editor specified during the day specified. + /// - active_users: The number of users who were shown Copilot completion suggestions in the editor specified during the day specified. + /// - additionalProperties: A container of undocumented properties. + public init( + language: Swift.String? = nil, + editor: Swift.String? = nil, + suggestions_count: Swift.Int? = nil, + acceptances_count: Swift.Int? = nil, + lines_suggested: Swift.Int? = nil, + lines_accepted: Swift.Int? = nil, + active_users: Swift.Int? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.language = language + self.editor = editor + self.suggestions_count = suggestions_count + self.acceptances_count = acceptances_count + self.lines_suggested = lines_suggested + self.lines_accepted = lines_accepted + self.active_users = active_users + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case language + case editor + case suggestions_count + case acceptances_count + case lines_suggested + case lines_accepted + case active_users + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + language = try container.decodeIfPresent( + Swift.String.self, + forKey: .language + ) + editor = try container.decodeIfPresent( + Swift.String.self, + forKey: .editor + ) + suggestions_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .suggestions_count + ) + acceptances_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .acceptances_count + ) + lines_suggested = try container.decodeIfPresent( + Swift.Int.self, + forKey: .lines_suggested + ) + lines_accepted = try container.decodeIfPresent( + Swift.Int.self, + forKey: .lines_accepted + ) + active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .active_users + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "language", + "editor", + "suggestions_count", + "acceptances_count", + "lines_suggested", + "lines_accepted", + "active_users" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent( + language, + forKey: .language + ) + try container.encodeIfPresent( + editor, + forKey: .editor + ) + try container.encodeIfPresent( + suggestions_count, + forKey: .suggestions_count + ) + try container.encodeIfPresent( + acceptances_count, + forKey: .acceptances_count + ) + try container.encodeIfPresent( + lines_suggested, + forKey: .lines_suggested + ) + try container.encodeIfPresent( + lines_accepted, + forKey: .lines_accepted + ) + try container.encodeIfPresent( + active_users, + forKey: .active_users + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// Breakdown of Copilot code completions usage by language and editor + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. + public typealias breakdownPayload = [Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayloadPayload] + /// Breakdown of Copilot code completions usage by language and editor + /// + /// - Remark: Generated from `#/components/schemas/copilot-usage-metrics/breakdown`. + public var breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? + /// Creates a new `copilot_hyphen_usage_hyphen_metrics`. + /// + /// - Parameters: + /// - day: The date for which the usage metrics are reported, in `YYYY-MM-DD` format. + /// - total_suggestions_count: The total number of Copilot code completion suggestions shown to users. + /// - total_acceptances_count: The total number of Copilot code completion suggestions accepted by users. + /// - total_lines_suggested: The total number of lines of code completions suggested by Copilot. + /// - total_lines_accepted: The total number of lines of code completions accepted by users. + /// - total_active_users: The total number of users who were shown Copilot code completion suggestions during the day specified. + /// - total_chat_acceptances: The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline). + /// - total_chat_turns: The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE. + /// - total_active_chat_users: The total number of users who interacted with Copilot Chat in the IDE during the day specified. + /// - breakdown: Breakdown of Copilot code completions usage by language and editor + public init( + day: Swift.String, + total_suggestions_count: Swift.Int? = nil, + total_acceptances_count: Swift.Int? = nil, + total_lines_suggested: Swift.Int? = nil, + total_lines_accepted: Swift.Int? = nil, + total_active_users: Swift.Int? = nil, + total_chat_acceptances: Swift.Int? = nil, + total_chat_turns: Swift.Int? = nil, + total_active_chat_users: Swift.Int? = nil, + breakdown: Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload? = nil + ) { + self.day = day + self.total_suggestions_count = total_suggestions_count + self.total_acceptances_count = total_acceptances_count + self.total_lines_suggested = total_lines_suggested + self.total_lines_accepted = total_lines_accepted + self.total_active_users = total_active_users + self.total_chat_acceptances = total_chat_acceptances + self.total_chat_turns = total_chat_turns + self.total_active_chat_users = total_active_chat_users + self.breakdown = breakdown + } + public enum CodingKeys: String, CodingKey { + case day + case total_suggestions_count + case total_acceptances_count + case total_lines_suggested + case total_lines_accepted + case total_active_users + case total_chat_acceptances + case total_chat_turns + case total_active_chat_users + case breakdown + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + day = try container.decode( + Swift.String.self, + forKey: .day + ) + total_suggestions_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_suggestions_count + ) + total_acceptances_count = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_acceptances_count + ) + total_lines_suggested = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_lines_suggested + ) + total_lines_accepted = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_lines_accepted + ) + total_active_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_users + ) + total_chat_acceptances = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_chat_acceptances + ) + total_chat_turns = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_chat_turns + ) + total_active_chat_users = try container.decodeIfPresent( + Swift.Int.self, + forKey: .total_active_chat_users + ) + breakdown = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_usage_hyphen_metrics.breakdownPayload.self, + forKey: .breakdown + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "day", + "total_suggestions_count", + "total_acceptances_count", + "total_lines_suggested", + "total_lines_accepted", + "total_active_users", + "total_chat_acceptances", + "total_chat_turns", + "total_active_chat_users", + "breakdown" + ]) + } + } + /// The breakdown of Copilot Business seats for the organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown`. + public struct copilot_hyphen_seat_hyphen_breakdown: Codable, Hashable, Sendable { + /// The total number of seats being billed for the organization as of the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/total`. + public var total: Swift.Int? + /// Seats added during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/added_this_cycle`. + public var added_this_cycle: Swift.Int? + /// The number of seats that are pending cancellation at the end of the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_cancellation`. + public var pending_cancellation: Swift.Int? + /// The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/pending_invitation`. + public var pending_invitation: Swift.Int? + /// The number of seats that have used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/active_this_cycle`. + public var active_this_cycle: Swift.Int? + /// The number of seats that have not used Copilot during the current billing cycle. + /// + /// - Remark: Generated from `#/components/schemas/copilot-seat-breakdown/inactive_this_cycle`. + public var inactive_this_cycle: Swift.Int? + /// Creates a new `copilot_hyphen_seat_hyphen_breakdown`. + /// + /// - Parameters: + /// - total: The total number of seats being billed for the organization as of the current billing cycle. + /// - added_this_cycle: Seats added during the current billing cycle. + /// - pending_cancellation: The number of seats that are pending cancellation at the end of the current billing cycle. + /// - pending_invitation: The number of seats that have been assigned to users that have not yet accepted an invitation to this organization. + /// - active_this_cycle: The number of seats that have used Copilot during the current billing cycle. + /// - inactive_this_cycle: The number of seats that have not used Copilot during the current billing cycle. + public init( + total: Swift.Int? = nil, + added_this_cycle: Swift.Int? = nil, + pending_cancellation: Swift.Int? = nil, + pending_invitation: Swift.Int? = nil, + active_this_cycle: Swift.Int? = nil, + inactive_this_cycle: Swift.Int? = nil + ) { + self.total = total + self.added_this_cycle = added_this_cycle + self.pending_cancellation = pending_cancellation + self.pending_invitation = pending_invitation + self.active_this_cycle = active_this_cycle + self.inactive_this_cycle = inactive_this_cycle + } + public enum CodingKeys: String, CodingKey { + case total + case added_this_cycle + case pending_cancellation + case pending_invitation + case active_this_cycle + case inactive_this_cycle + } + } + /// Information about the seat breakdown and policies set for an organization with a Copilot Business or Copilot Enterprise subscription. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details`. + public struct copilot_hyphen_organization_hyphen_details: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_breakdown`. + public var seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown + /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + @frozen public enum public_code_suggestionsPayload: String, Codable, Hashable, Sendable { + case allow = "allow" + case block = "block" + case unconfigured = "unconfigured" + case unknown = "unknown" + } + /// The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/public_code_suggestions`. + public var public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload + /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + @frozen public enum ide_chatPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/ide_chat`. + public var ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? + /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + @frozen public enum platform_chatPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/platform_chat`. + public var platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? + /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + @frozen public enum cliPayload: String, Codable, Hashable, Sendable { + case enabled = "enabled" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/cli`. + public var cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? + /// The mode of assigning new seats. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + @frozen public enum seat_management_settingPayload: String, Codable, Hashable, Sendable { + case assign_all = "assign_all" + case assign_selected = "assign_selected" + case disabled = "disabled" + case unconfigured = "unconfigured" + } + /// The mode of assigning new seats. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/seat_management_setting`. + public var seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. + @frozen public enum plan_typePayload: String, Codable, Hashable, Sendable { + case business = "business" + case enterprise = "enterprise" + case unknown = "unknown" + } + /// The Copilot plan of the organization, or the parent enterprise, when applicable. + /// + /// - Remark: Generated from `#/components/schemas/copilot-organization-details/plan_type`. + public var plan_type: Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload? + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `copilot_hyphen_organization_hyphen_details`. + /// + /// - Parameters: + /// - seat_breakdown: + /// - public_code_suggestions: The organization policy for allowing or disallowing Copilot to make suggestions that match public code. + /// - ide_chat: The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor. + /// - platform_chat: The organization policy for allowing or disallowing organization members to use Copilot features within github.com. + /// - cli: The organization policy for allowing or disallowing organization members to use Copilot within their CLI. + /// - seat_management_setting: The mode of assigning new seats. + /// - plan_type: The Copilot plan of the organization, or the parent enterprise, when applicable. + /// - additionalProperties: A container of undocumented properties. + public init( + seat_breakdown: Components.Schemas.copilot_hyphen_seat_hyphen_breakdown, + public_code_suggestions: Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload, + ide_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload? = nil, + platform_chat: Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload? = nil, + cli: Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload? = nil, + seat_management_setting: Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload, + plan_type: Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload? = nil, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.seat_breakdown = seat_breakdown + self.public_code_suggestions = public_code_suggestions + self.ide_chat = ide_chat + self.platform_chat = platform_chat + self.cli = cli + self.seat_management_setting = seat_management_setting + self.plan_type = plan_type + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case seat_breakdown + case public_code_suggestions + case ide_chat + case platform_chat + case cli + case seat_management_setting + case plan_type + } + public init(from decoder: any Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + seat_breakdown = try container.decode( + Components.Schemas.copilot_hyphen_seat_hyphen_breakdown.self, + forKey: .seat_breakdown + ) + public_code_suggestions = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_details.public_code_suggestionsPayload.self, + forKey: .public_code_suggestions + ) + ide_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.ide_chatPayload.self, + forKey: .ide_chat + ) + platform_chat = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.platform_chatPayload.self, + forKey: .platform_chat + ) + cli = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.cliPayload.self, + forKey: .cli + ) + seat_management_setting = try container.decode( + Components.Schemas.copilot_hyphen_organization_hyphen_details.seat_management_settingPayload.self, + forKey: .seat_management_setting + ) + plan_type = try container.decodeIfPresent( + Components.Schemas.copilot_hyphen_organization_hyphen_details.plan_typePayload.self, + forKey: .plan_type + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "seat_breakdown", + "public_code_suggestions", + "ide_chat", + "platform_chat", + "cli", + "seat_management_setting", + "plan_type" + ]) + } + public func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + seat_breakdown, + forKey: .seat_breakdown + ) + try container.encode( + public_code_suggestions, + forKey: .public_code_suggestions + ) + try container.encodeIfPresent( + ide_chat, + forKey: .ide_chat + ) + try container.encodeIfPresent( + platform_chat, + forKey: .platform_chat + ) + try container.encodeIfPresent( + cli, + forKey: .cli + ) + try container.encode( + seat_management_setting, + forKey: .seat_management_setting + ) + try container.encodeIfPresent( + plan_type, + forKey: .plan_type + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + } + /// Types generated from the `#/components/parameters` section of the OpenAPI document. + public enum Parameters { + /// 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. You can also substitute this value with the enterprise id. + /// + /// - Remark: Generated from `#/components/parameters/enterprise`. + public typealias enterprise = Swift.String + /// The slug of the enterprise team name. + /// + /// - Remark: Generated from `#/components/parameters/enterprise-team-slug`. + public typealias enterprise_hyphen_team_hyphen_slug = Swift.String + /// The slug of the team name. + /// + /// - Remark: Generated from `#/components/parameters/team-slug`. + public typealias team_hyphen_slug = Swift.String + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/components/parameters/org`. + public typealias org = Swift.String + /// The handle for the GitHub user account. + /// + /// - Remark: Generated from `#/components/parameters/username`. + public typealias username = Swift.String + } + /// 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 not_found: 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.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.not_found.Body + /// Creates a new `not_found`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.not_found.Body) { + self.body = body + } + } + public struct requires_authentication: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.requires_authentication.Body + /// Creates a new `requires_authentication`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.requires_authentication.Body) { + self.body = body + } + } + public struct forbidden: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/forbidden/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.forbidden.Body + /// Creates a new `forbidden`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.forbidden.Body) { + self.body = body + } + } + public struct internal_error: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.internal_error.Body + /// Creates a new `internal_error`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.internal_error.Body) { + self.body = body + } + } + public struct usage_metrics_api_disabled: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/components/responses/usage_metrics_api_disabled/content/application\/json`. + case json(Components.Schemas.basic_hyphen_error) + /// 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.basic_hyphen_error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Components.Responses.usage_metrics_api_disabled.Body + /// Creates a new `usage_metrics_api_disabled`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Components.Responses.usage_metrics_api_disabled.Body) { + self.body = body + } + } + } + /// Types generated from the `#/components/headers` section of the OpenAPI document. + public enum Headers { + /// - Remark: Generated from `#/components/headers/link`. + public typealias link = Swift.String + } +} + +/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. +public enum Operations { + /// List all Copilot seat assignments for an enterprise + /// + /// > [!NOTE] + /// > This endpoint is in public preview and is subject to change. + /// + /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. + /// + /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// + /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// + /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// + /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. + public enum copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "copilot/list-copilot-seats-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + public init(enterprise: Components.Parameters.enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query`. + public struct Query: Sendable, Hashable { + /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/per_page`. + public var per_page: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - page: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + public init( + page: Components.Parameters.page? = nil, + per_page: Swift.Int? = nil + ) { + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/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.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers`. + public struct Headers: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers/Link`. + public var Link: Components.Headers.link? + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - Link: + public init(Link: Components.Headers.link? = nil) { + self.Link = Link + } + } + /// Received HTTP response headers + public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json`. + public struct jsonPayload: Codable, Hashable, Sendable { + /// The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. + public var total_seats: Swift.Int? + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/seats`. + public var seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? + /// Creates a new `jsonPayload`. + /// + /// - Parameters: + /// - total_seats: The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. + /// - seats: + public init( + total_seats: Swift.Int? = nil, + seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? = nil + ) { + self.total_seats = total_seats + self.seats = seats + } + public enum CodingKeys: String, CodingKey { + case total_seats + case seats + } + } + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/application\/json`. + case json(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - headers: Received HTTP response headers + /// - body: Received HTTP response body + public init( + headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers = .init(), + body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + ) { + self.headers = headers + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.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.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.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//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// 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.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + /// Requires authentication + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Components.Responses.requires_authentication) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Components.Responses.requires_authentication { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// The associated value of the enum case if `self` is `.forbidden`. + /// + /// - Throws: An error if `self` is not `.forbidden`. + /// - SeeAlso: `.forbidden`. + public var forbidden: Components.Responses.forbidden { + get throws { + switch self { + case let .forbidden(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "forbidden", + response: self + ) + } + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.not_found.Body - /// Creates a new `not_found`. + /// 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 enterprise + /// + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. + /// + /// The response contains metrics for up to 28 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 or set to "no policy" for the enterprise within GitHub settings. + /// Only enterprise owners and billing managers can view Copilot metrics for the enterprise. + /// + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)`. + public enum copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "copilot/copilot-metrics-for-enterprise" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/path`. + public struct Path: Sendable, Hashable { + /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/path/enterprise`. + public var enterprise: Components.Parameters.enterprise + /// Creates a new `Path`. + /// + /// - Parameters: + /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. + public init(enterprise: Components.Parameters.enterprise) { + self.enterprise = enterprise + } + } + public var path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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 28 days ago. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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/enterprises/{enterprise}/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/enterprises/{enterprise}/copilot/metrics/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/query/per_page`. + public var per_page: 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 28 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)." + /// - per_page: The number of days of metrics to display per page (max 28). For 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, + per_page: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers + /// Creates a new `Input`. /// /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.not_found.Body) { - self.body = body + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers } } - public struct requires_authentication: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/requires_authentication/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// 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.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/metrics/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) + /// 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.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { + get throws { + switch self { + case let .json(body): + return body + } } } } + /// Received HTTP response body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + self.body = body + } } - /// Received HTTP response body - public var body: Components.Responses.requires_authentication.Body - /// Creates a new `requires_authentication`. + /// Response /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.requires_authentication.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } } - } - 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.basic_hyphen_error) - /// 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.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// Internal Error + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Components.Responses.internal_error) + /// 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.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.forbidden.Body - /// Creates a new `forbidden`. + /// Forbidden /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.forbidden.Body) { - self.body = body + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/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 + ) + } + } } - } - public struct internal_error: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/components/responses/internal_error/content/application\/json`. - case json(Components.Schemas.basic_hyphen_error) - /// 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.basic_hyphen_error { - get throws { - switch self { - case let .json(body): - return body - } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.usage_metrics_api_disabled) + /// 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.usage_metrics_api_disabled { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) } } } - /// Received HTTP response body - public var body: Components.Responses.internal_error.Body - /// Creates a new `internal_error`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Components.Responses.internal_error.Body) { - self.body = body + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] } } } - /// Types generated from the `#/components/headers` section of the OpenAPI document. - public enum Headers { - /// - Remark: Generated from `#/components/headers/link`. - public typealias link = Swift.String - } -} - -/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document. -public enum Operations { - /// List all Copilot seat assignments for an enterprise + /// Get a summary of Copilot usage for enterprise members /// /// > [!NOTE] /// > This endpoint is in public preview and is subject to change. /// - /// Lists all active Copilot seats across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription. - /// - /// Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once. + /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE + /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, + /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. /// - /// For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array. + /// The response contains metrics for up to 28 days prior. Usage 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. /// - /// Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams. + /// Only owners and billing managers can view Copilot usage metrics for the enterprise. /// - /// Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. + /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/billing/seats`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)`. - public enum copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise { - public static let id: Swift.String = "copilot/list-copilot-seats-for-enterprise" + /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. + public enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise { + public static let id: Swift.String = "copilot/usage-metrics-for-enterprise" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path`. public struct Path: Sendable, Hashable { /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/path/enterprise`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path/enterprise`. public var enterprise: Components.Parameters.enterprise /// Creates a new `Path`. /// @@ -2099,43 +3786,57 @@ public enum Operations { self.enterprise = enterprise } } - public var path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query`. + public var path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/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 28 days ago. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/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/enterprises/{enterprise}/copilot/usage/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/enterprises/{enterprise}/copilot/billing/seats/GET/query/page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/page`. public var page: Components.Parameters.page? - /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/query/per_page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/per_page`. public var per_page: 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 28 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)." - /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - per_page: The number of days of metrics to display per page (max 28). For 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, per_page: Swift.Int? = nil ) { + self.since = since + self.until = until self.page = page self.per_page = per_page } } - public var query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/header`. + public var query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers + public var headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -2143,9 +3844,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Path, - query: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Query = .init(), - headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Input.Headers = .init() + path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, + query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), + headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() ) { self.path = path self.query = query @@ -2154,54 +3855,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/headers/Link`. - public var Link: Components.Headers.link? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - Link: - public init(Link: Components.Headers.link? = nil) { - self.Link = Link - } - } - /// Received HTTP response headers - public var headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json`. - public struct jsonPayload: Codable, Hashable, Sendable { - /// The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. - /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/total_seats`. - public var total_seats: Swift.Int? - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/json/seats`. - public var seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? - /// Creates a new `jsonPayload`. - /// - /// - Parameters: - /// - total_seats: The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. - /// - seats: - public init( - total_seats: Swift.Int? = nil, - seats: [Components.Schemas.copilot_hyphen_seat_hyphen_details]? = nil - ) { - self.total_seats = total_seats - self.seats = seats - } - public enum CodingKeys: String, CodingKey { - case total_seats - case seats - } - } - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/billing/seats/GET/responses/200/content/application\/json`. - case json(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body.jsonPayload { + public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics] { get throws { switch self { case let .json(body): @@ -2211,31 +3873,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body + public var body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Headers = .init(), - body: Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok) + case ok(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.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.copilot_sol_list_hyphen_copilot_hyphen_seats_hyphen_for_hyphen_enterprise.Output.Ok { + public var ok: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok { get throws { switch self { case let .ok(response): @@ -2250,7 +3907,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.internal_error) @@ -2273,7 +3930,7 @@ public enum Operations { } /// Requires authentication /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/401`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/401`. /// /// HTTP response code: `401 unauthorized`. case unauthorized(Components.Responses.requires_authentication) @@ -2296,7 +3953,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.forbidden) @@ -2319,7 +3976,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/billing/seats/get(copilot/list-copilot-seats-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -2371,60 +4028,68 @@ public enum Operations { } } } - /// Get a summary of Copilot usage for enterprise members + /// Get Copilot metrics for an enterprise team /// - /// > [!NOTE] - /// > This endpoint is in public preview and is subject to change. - /// - /// You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE - /// for all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances, - /// and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions. + /// Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions. /// - /// The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day, + /// The response contains metrics for up to 28 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. /// - /// Only owners and billing managers can view Copilot usage metrics for the enterprise. + /// > [!NOTE] + /// > This endpoint will only return results for a given day if the enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day. + /// + /// To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. + /// Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team. /// /// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. /// - /// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`. - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`. - public enum copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise { - public static let id: Swift.String = "copilot/usage-metrics-for-enterprise" + /// - Remark: HTTP `GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)`. + public enum copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team { + public static let id: Swift.String = "copilot/copilot-metrics-for-enterprise-team" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/path`. public struct Path: Sendable, Hashable { /// The slug version of the enterprise name. You can also substitute this value with the enterprise id. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/path/enterprise`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/path/enterprise`. public var enterprise: Components.Parameters.enterprise + /// The slug of the enterprise team name. + /// + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/path/team_slug`. + public var team_slug: Components.Parameters.enterprise_hyphen_team_hyphen_slug /// Creates a new `Path`. /// /// - Parameters: /// - enterprise: The slug version of the enterprise name. You can also substitute this value with the enterprise id. - public init(enterprise: Components.Parameters.enterprise) { + /// - team_slug: The slug of the enterprise team name. + public init( + enterprise: Components.Parameters.enterprise, + team_slug: Components.Parameters.enterprise_hyphen_team_hyphen_slug + ) { self.enterprise = enterprise + self.team_slug = team_slug } } - public var path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query`. + public var path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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 28 days ago. /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/since`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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/enterprises/{enterprise}/copilot/usage/GET/query/until`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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/enterprises/{enterprise}/copilot/usage/GET/query/page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/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 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/query/per_page`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/query/per_page`. public var per_page: Swift.Int? /// Creates a new `Query`. /// @@ -2445,19 +4110,19 @@ public enum Operations { self.per_page = per_page } } - public var query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/header`. + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers + public var headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers /// Creates a new `Input`. /// /// - Parameters: @@ -2465,9 +4130,9 @@ public enum Operations { /// - query: /// - headers: public init( - path: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Path, - query: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Query = .init(), - headers: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Input.Headers = .init() + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Input.Headers = .init() ) { self.path = path self.query = query @@ -2476,15 +4141,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/enterprises/{enterprise}/copilot/usage/GET/responses/200/content/application\/json`. - case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics]) + /// - Remark: Generated from `#/paths/enterprises/{enterprise}/team/{team_slug}/copilot/metrics/GET/responses/200/content/application\/json`. + case json([Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) /// 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.copilot_hyphen_usage_hyphen_metrics] { + public var json: [Components.Schemas.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { get throws { switch self { case let .json(body): @@ -2494,26 +4159,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok.Body) { + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok.Body) { self.body = body } } /// Response /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/200`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok) + case ok(Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.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.copilot_sol_usage_hyphen_metrics_hyphen_for_hyphen_enterprise.Output.Ok { + public var ok: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_enterprise_hyphen_team.Output.Ok { get throws { switch self { case let .ok(response): @@ -2528,7 +4193,7 @@ public enum Operations { } /// Internal Error /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/500`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/500`. /// /// HTTP response code: `500 internalServerError`. case internalServerError(Components.Responses.internal_error) @@ -2549,32 +4214,9 @@ public enum Operations { } } } - /// Requires authentication - /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/401`. - /// - /// HTTP response code: `401 unauthorized`. - case unauthorized(Components.Responses.requires_authentication) - /// The associated value of the enum case if `self` is `.unauthorized`. - /// - /// - Throws: An error if `self` is not `.unauthorized`. - /// - SeeAlso: `.unauthorized`. - public var unauthorized: Components.Responses.requires_authentication { - get throws { - switch self { - case let .unauthorized(response): - return response - default: - try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", - response: self - ) - } - } - } /// Forbidden /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/403`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.forbidden) @@ -2597,22 +4239,45 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)/responses/404`. + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) /// The associated value of the enum case if `self` is `.notFound`. /// - /// - Throws: An error if `self` is not `.notFound`. - /// - SeeAlso: `.notFound`. - public var notFound: Components.Responses.not_found { + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. + /// + /// - Remark: Generated from `#/paths//enterprises/{enterprise}/team/{team_slug}/copilot/metrics/get(copilot/copilot-metrics-for-enterprise-team)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.usage_metrics_api_disabled) + /// 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.usage_metrics_api_disabled { get throws { switch self { - case let .notFound(response): + case let .unprocessableContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "notFound", + expectedStatus: "unprocessableContent", response: self ) } @@ -4618,7 +6283,288 @@ public enum Operations { return response default: try throwUnexpectedResponseStatus( - expectedStatus: "unauthorized", + expectedStatus: "unauthorized", + response: self + ) + } + } + } + /// Forbidden + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. + /// + /// HTTP response code: `403 forbidden`. + case forbidden(Components.Responses.forbidden) + /// 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/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Components.Responses.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct UnprocessableContent: Sendable, Hashable { + /// Creates a new `UnprocessableContent`. + public init() {} + } + /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get 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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization { + 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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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 28 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 28). For 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 per_page: 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 28 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)." + /// - per_page: The number of days of metrics to display per page (max 28). For 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, + per_page: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) + /// 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.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_organization.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.internal_error) + /// 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.internal_error { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", response: self ) } @@ -4626,7 +6572,7 @@ public enum Operations { } /// Forbidden /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/403`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/403`. /// /// HTTP response code: `403 forbidden`. case forbidden(Components.Responses.forbidden) @@ -4649,7 +6595,7 @@ public enum Operations { } /// Resource not found /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/404`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/404`. /// /// HTTP response code: `404 notFound`. case notFound(Components.Responses.not_found) @@ -4670,21 +6616,17 @@ public enum Operations { } } } - public struct UnprocessableContent: Sendable, Hashable { - /// Creates a new `UnprocessableContent`. - public init() {} - } - /// Copilot Business or Enterprise is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. + /// Copilot Usage Merics API setting is disabled at the organization or enterprise level. /// - /// - Remark: Generated from `#/paths//orgs/{org}/copilot/billing/selected_users/delete(copilot/cancel-copilot-seat-assignment-for-users)/responses/422`. + /// - Remark: Generated from `#/paths//orgs/{org}/copilot/metrics/get(copilot/copilot-metrics-for-organization)/responses/422`. /// /// HTTP response code: `422 unprocessableContent`. - case unprocessableContent(Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent) + case unprocessableContent(Components.Responses.usage_metrics_api_disabled) /// The associated value of the enum case if `self` is `.unprocessableContent`. /// /// - Throws: An error if `self` is not `.unprocessableContent`. /// - SeeAlso: `.unprocessableContent`. - public var unprocessableContent: Operations.copilot_sol_cancel_hyphen_copilot_hyphen_seat_hyphen_assignment_hyphen_for_hyphen_users.Output.UnprocessableContent { + public var unprocessableContent: Components.Responses.usage_metrics_api_disabled { get throws { switch self { case let .unprocessableContent(response): @@ -5273,6 +7215,292 @@ 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 28 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 copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team { + 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 team_slug: Components.Parameters.team_hyphen_slug + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - team_slug: The slug of the team name. + public init( + org: Components.Parameters.org, + team_slug: Components.Parameters.team_hyphen_slug + ) { + self.org = org + self.team_slug = team_slug + } + } + public var path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.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 28 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 28). For 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 per_page: 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 28 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)." + /// - per_page: The number of days of metrics to display per page (max 28). For 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, + per_page: Swift.Int? = nil + ) { + self.since = since + self.until = until + self.page = page + self.per_page = per_page + } + } + public var query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Path, + query: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Input.Query = .init(), + headers: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.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.copilot_hyphen_usage_hyphen_metrics_hyphen_day]) + /// 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.copilot_hyphen_usage_hyphen_metrics_hyphen_day] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.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.copilot_sol_copilot_hyphen_metrics_hyphen_for_hyphen_team.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.internal_error) + /// 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.internal_error { + 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.not_found) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Components.Responses.not_found { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + /// Copilot Usage Merics 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.usage_metrics_api_disabled) + /// 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.usage_metrics_api_disabled { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// Get a summary of Copilot usage for a team /// /// > [!NOTE] diff --git a/Sources/orgs/Client.swift b/Sources/orgs/Client.swift index f77961fc261..fa05bb49a73 100644 --- a/Sources/orgs/Client.swift +++ b/Sources/orgs/Client.swift @@ -1641,13 +1641,6 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "redelivery", - value: input.query.redelivery - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -2064,6 +2057,822 @@ public struct Client: APIProtocol { } ) } + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/route-stats/{}/{}", + parameters: [ + input.path.org, + input.path.actor_type, + input.path.actor_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + 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.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + 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.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.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.api_hyphen_insights_hyphen_route_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public func api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/subject-stats", + 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: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + 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.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + 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.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.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.api_hyphen_insights_hyphen_subject_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/summary-stats", + 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: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + 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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.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.api_hyphen_insights_hyphen_summary_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/summary-stats/users/{}", + parameters: [ + input.path.org, + input.path.user_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + 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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.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.api_hyphen_insights_hyphen_summary_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/summary-stats/{}/{}", + parameters: [ + input.path.org, + input.path.actor_type, + input.path.actor_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + 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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.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.api_hyphen_insights_hyphen_summary_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/time-stats", + 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: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestamp_increment + ) + 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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.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.api_hyphen_insights_hyphen_time_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get time stats by user + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/time-stats/users/{}", + parameters: [ + input.path.org, + input.path.user_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestamp_increment + ) + 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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.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.api_hyphen_insights_hyphen_time_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get time stats by actor + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/time-stats/{}/{}", + parameters: [ + input.path.org, + input.path.actor_type, + input.path.actor_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "timestamp_increment", + value: input.query.timestamp_increment + ) + 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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.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.api_hyphen_insights_hyphen_time_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Get user stats + /// + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public func api_hyphen_insights_sol_get_hyphen_user_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output { + try await client.send( + input: input, + forOperation: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/orgs/{}/insights/api/user-stats/{}", + parameters: [ + input.path.org, + input.path.user_id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "min_timestamp", + value: input.query.min_timestamp + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "max_timestamp", + value: input.query.max_timestamp + ) + 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.per_page + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "direction", + value: input.query.direction + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "sort", + value: input.query.sort + ) + 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.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.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.api_hyphen_insights_hyphen_user_hyphen_stats.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// List app installations for an organization /// /// Lists all GitHub Apps in an organization. The installation count includes diff --git a/Sources/orgs/Types.swift b/Sources/orgs/Types.swift index 200e17216fa..ec2df9e14aa 100644 --- a/Sources/orgs/Types.swift +++ b/Sources/orgs/Types.swift @@ -246,6 +246,69 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /orgs/{org}/hooks/{hook_id}/pings`. /// - Remark: Generated from `#/paths//orgs/{org}/hooks/{hook_id}/pings/post(orgs/ping-webhook)`. func orgs_sol_ping_hyphen_webhook(_ input: Operations.orgs_sol_ping_hyphen_webhook.Input) async throws -> Operations.orgs_sol_ping_hyphen_webhook.Output + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + func api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + func api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output + /// Get time stats by user + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output + /// Get time stats by actor + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor(_ input: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output + /// Get user stats + /// + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + func api_hyphen_insights_sol_get_hyphen_user_hyphen_stats(_ input: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output /// List app installations for an organization /// /// Lists all GitHub Apps in an organization. The installation count includes @@ -1167,6 +1230,159 @@ extension APIProtocol { headers: headers )) } + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor( + path: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor(Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public func api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output { + try await api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_time_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get time stats by user + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output { + try await api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get time stats by actor + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public func api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output { + try await api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input( + path: path, + query: query, + headers: headers + )) + } + /// Get user stats + /// + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public func api_hyphen_insights_sol_get_hyphen_user_hyphen_stats( + path: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Headers = .init() + ) async throws -> Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output { + try await api_hyphen_insights_sol_get_hyphen_user_hyphen_stats(Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input( + path: path, + query: query, + headers: headers + )) + } /// List app installations for an organization /// /// Lists all GitHub Apps in an organization. The installation count includes @@ -5872,6 +6088,253 @@ public enum Components { case _type = "type" } } + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats`. + public struct api_hyphen_insights_hyphen_route_hyphen_statsPayload: Codable, Hashable, Sendable { + /// The HTTP method + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/http_method`. + public var http_method: Swift.String? + /// The API path's route template + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/api_route`. + public var api_route: Swift.String? + /// The total number of requests within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int64? + /// The total number of requests that were rate limited within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/last_rate_limited_timestamp`. + public var last_rate_limited_timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_route_hyphen_stats/last_request_timestamp`. + public var last_request_timestamp: Swift.String? + /// Creates a new `api_hyphen_insights_hyphen_route_hyphen_statsPayload`. + /// + /// - Parameters: + /// - http_method: The HTTP method + /// - api_route: The API path's route template + /// - total_request_count: The total number of requests within the queried time period + /// - rate_limited_request_count: The total number of requests that were rate limited within the queried time period + /// - last_rate_limited_timestamp: + /// - last_request_timestamp: + public init( + http_method: Swift.String? = nil, + api_route: Swift.String? = nil, + total_request_count: Swift.Int64? = nil, + rate_limited_request_count: Swift.Int64? = nil, + last_rate_limited_timestamp: Swift.String? = nil, + last_request_timestamp: Swift.String? = nil + ) { + self.http_method = http_method + self.api_route = api_route + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + self.last_rate_limited_timestamp = last_rate_limited_timestamp + self.last_request_timestamp = last_request_timestamp + } + public enum CodingKeys: String, CodingKey { + case http_method + case api_route + case total_request_count + case rate_limited_request_count + case last_rate_limited_timestamp + case last_request_timestamp + } + } + /// API Insights usage route stats for an actor + /// + /// - Remark: Generated from `#/components/schemas/api-insights-route-stats`. + public typealias api_hyphen_insights_hyphen_route_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_route_hyphen_statsPayload] + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats`. + public struct api_hyphen_insights_hyphen_subject_hyphen_statsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/subject_type`. + public var subject_type: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/subject_name`. + public var subject_name: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/subject_id`. + public var subject_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/last_rate_limited_timestamp`. + public var last_rate_limited_timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_subject_hyphen_stats/last_request_timestamp`. + public var last_request_timestamp: Swift.String? + /// Creates a new `api_hyphen_insights_hyphen_subject_hyphen_statsPayload`. + /// + /// - Parameters: + /// - subject_type: + /// - subject_name: + /// - subject_id: + /// - total_request_count: + /// - rate_limited_request_count: + /// - last_rate_limited_timestamp: + /// - last_request_timestamp: + public init( + subject_type: Swift.String? = nil, + subject_name: Swift.String? = nil, + subject_id: Swift.Int64? = nil, + total_request_count: Swift.Int? = nil, + rate_limited_request_count: Swift.Int? = nil, + last_rate_limited_timestamp: Swift.String? = nil, + last_request_timestamp: Swift.String? = nil + ) { + self.subject_type = subject_type + self.subject_name = subject_name + self.subject_id = subject_id + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + self.last_rate_limited_timestamp = last_rate_limited_timestamp + self.last_request_timestamp = last_request_timestamp + } + public enum CodingKeys: String, CodingKey { + case subject_type + case subject_name + case subject_id + case total_request_count + case rate_limited_request_count + case last_rate_limited_timestamp + case last_request_timestamp + } + } + /// API Insights usage subject stats for an organization + /// + /// - Remark: Generated from `#/components/schemas/api-insights-subject-stats`. + public typealias api_hyphen_insights_hyphen_subject_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_subject_hyphen_statsPayload] + /// API Insights usage summary stats for an organization + /// + /// - Remark: Generated from `#/components/schemas/api-insights-summary-stats`. + public struct api_hyphen_insights_hyphen_summary_hyphen_stats: Codable, Hashable, Sendable { + /// The total number of requests within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api-insights-summary-stats/total_request_count`. + public var total_request_count: Swift.Int64? + /// The total number of requests that were rate limited within the queried time period + /// + /// - Remark: Generated from `#/components/schemas/api-insights-summary-stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int64? + /// Creates a new `api_hyphen_insights_hyphen_summary_hyphen_stats`. + /// + /// - Parameters: + /// - total_request_count: The total number of requests within the queried time period + /// - rate_limited_request_count: The total number of requests that were rate limited within the queried time period + public init( + total_request_count: Swift.Int64? = nil, + rate_limited_request_count: Swift.Int64? = nil + ) { + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + } + public enum CodingKeys: String, CodingKey { + case total_request_count + case rate_limited_request_count + } + } + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats`. + public struct api_hyphen_insights_hyphen_time_hyphen_statsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats/timestamp`. + public var timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_time_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int64? + /// Creates a new `api_hyphen_insights_hyphen_time_hyphen_statsPayload`. + /// + /// - Parameters: + /// - timestamp: + /// - total_request_count: + /// - rate_limited_request_count: + public init( + timestamp: Swift.String? = nil, + total_request_count: Swift.Int64? = nil, + rate_limited_request_count: Swift.Int64? = nil + ) { + self.timestamp = timestamp + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + } + public enum CodingKeys: String, CodingKey { + case timestamp + case total_request_count + case rate_limited_request_count + } + } + /// API Insights usage time stats for an organization + /// + /// - Remark: Generated from `#/components/schemas/api-insights-time-stats`. + public typealias api_hyphen_insights_hyphen_time_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_statsPayload] + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats`. + public struct api_hyphen_insights_hyphen_user_hyphen_statsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/actor_type`. + public var actor_type: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/actor_name`. + public var actor_name: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/actor_id`. + public var actor_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/integration_id`. + public var integration_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/oauth_application_id`. + public var oauth_application_id: Swift.Int64? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/total_request_count`. + public var total_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/rate_limited_request_count`. + public var rate_limited_request_count: Swift.Int? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/last_rate_limited_timestamp`. + public var last_rate_limited_timestamp: Swift.String? + /// - Remark: Generated from `#/components/schemas/api_hyphen_insights_hyphen_user_hyphen_stats/last_request_timestamp`. + public var last_request_timestamp: Swift.String? + /// Creates a new `api_hyphen_insights_hyphen_user_hyphen_statsPayload`. + /// + /// - Parameters: + /// - actor_type: + /// - actor_name: + /// - actor_id: + /// - integration_id: + /// - oauth_application_id: + /// - total_request_count: + /// - rate_limited_request_count: + /// - last_rate_limited_timestamp: + /// - last_request_timestamp: + public init( + actor_type: Swift.String? = nil, + actor_name: Swift.String? = nil, + actor_id: Swift.Int64? = nil, + integration_id: Swift.Int64? = nil, + oauth_application_id: Swift.Int64? = nil, + total_request_count: Swift.Int? = nil, + rate_limited_request_count: Swift.Int? = nil, + last_rate_limited_timestamp: Swift.String? = nil, + last_request_timestamp: Swift.String? = nil + ) { + self.actor_type = actor_type + self.actor_name = actor_name + self.actor_id = actor_id + self.integration_id = integration_id + self.oauth_application_id = oauth_application_id + self.total_request_count = total_request_count + self.rate_limited_request_count = rate_limited_request_count + self.last_rate_limited_timestamp = last_rate_limited_timestamp + self.last_request_timestamp = last_request_timestamp + } + public enum CodingKeys: String, CodingKey { + case actor_type + case actor_name + case actor_id + case integration_id + case oauth_application_id + case total_request_count + case rate_limited_request_count + case last_rate_limited_timestamp + case last_request_timestamp + } + } + /// API Insights usage stats for a user + /// + /// - Remark: Generated from `#/components/schemas/api-insights-user-stats`. + public typealias api_hyphen_insights_hyphen_user_hyphen_stats = [Components.Schemas.api_hyphen_insights_hyphen_user_hyphen_statsPayload] /// Org Membership /// /// - Remark: Generated from `#/components/schemas/org-membership`. @@ -6541,6 +7004,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant-request/created_at`. public var created_at: Swift.String + /// Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + /// + /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant-request/token_id`. + public var token_id: Swift.Int /// Whether the associated fine-grained personal access token has expired. /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant-request/token_expired`. @@ -6563,6 +7030,7 @@ public enum Components { /// - repositories_url: URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. /// - permissions: Permissions requested, categorized by type of permission. /// - created_at: Date and time when the request for access was created. + /// - token_id: Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. /// - token_expired: Whether the associated fine-grained personal access token has expired. /// - token_expires_at: Date and time when the associated fine-grained personal access token expires. /// - token_last_used_at: Date and time when the associated fine-grained personal access token was last used for authentication. @@ -6574,6 +7042,7 @@ public enum Components { repositories_url: Swift.String, permissions: Components.Schemas.organization_hyphen_programmatic_hyphen_access_hyphen_grant_hyphen_request.permissionsPayload, created_at: Swift.String, + token_id: Swift.Int, token_expired: Swift.Bool, token_expires_at: Swift.String? = nil, token_last_used_at: Swift.String? = nil @@ -6585,6 +7054,7 @@ public enum Components { self.repositories_url = repositories_url self.permissions = permissions self.created_at = created_at + self.token_id = token_id self.token_expired = token_expired self.token_expires_at = token_expires_at self.token_last_used_at = token_last_used_at @@ -6597,6 +7067,7 @@ public enum Components { case repositories_url case permissions case created_at + case token_id case token_expired case token_expires_at case token_last_used_at @@ -6606,7 +7077,7 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant`. public struct organization_hyphen_programmatic_hyphen_access_hyphen_grant: Codable, Hashable, Sendable { - /// Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. + /// Unique identifier of the fine-grained personal access token grant. The `pat_id` used to get details about an approved fine-grained personal access token. /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/id`. public var id: Swift.Int @@ -6721,6 +7192,10 @@ public enum Components { /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/access_granted_at`. public var access_granted_at: Swift.String + /// Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. + /// + /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/token_id`. + public var token_id: Swift.Int /// Whether the associated fine-grained personal access token has expired. /// /// - Remark: Generated from `#/components/schemas/organization-programmatic-access-grant/token_expired`. @@ -6736,12 +7211,13 @@ public enum Components { /// Creates a new `organization_hyphen_programmatic_hyphen_access_hyphen_grant`. /// /// - Parameters: - /// - id: Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. + /// - id: Unique identifier of the fine-grained personal access token grant. The `pat_id` used to get details about an approved fine-grained personal access token. /// - owner: /// - repository_selection: Type of repository selection requested. /// - repositories_url: URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. /// - permissions: Permissions requested, categorized by type of permission. /// - access_granted_at: Date and time when the fine-grained personal access token was approved to access the organization. + /// - token_id: Unique identifier of the user's token. This field can also be found in audit log events and the organization's settings for their PAT grants. /// - token_expired: Whether the associated fine-grained personal access token has expired. /// - token_expires_at: Date and time when the associated fine-grained personal access token expires. /// - token_last_used_at: Date and time when the associated fine-grained personal access token was last used for authentication. @@ -6752,6 +7228,7 @@ public enum Components { repositories_url: Swift.String, permissions: Components.Schemas.organization_hyphen_programmatic_hyphen_access_hyphen_grant.permissionsPayload, access_granted_at: Swift.String, + token_id: Swift.Int, token_expired: Swift.Bool, token_expires_at: Swift.String? = nil, token_last_used_at: Swift.String? = nil @@ -6762,6 +7239,7 @@ public enum Components { self.repositories_url = repositories_url self.permissions = permissions self.access_granted_at = access_granted_at + self.token_id = token_id self.token_expired = token_expired self.token_expires_at = token_expires_at self.token_last_used_at = token_last_used_at @@ -6773,6 +7251,7 @@ public enum Components { case repositories_url case permissions case access_granted_at + case token_id case token_expired case token_expires_at case token_last_used_at @@ -7066,6 +7545,61 @@ public enum Components { /// /// - Remark: Generated from `#/components/parameters/hook-id`. public typealias hook_hyphen_id = Swift.Int + /// The type of the actor + /// + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The ID of the actor + /// + /// - Remark: Generated from `#/components/parameters/api-insights-actor-id`. + public typealias api_hyphen_insights_hyphen_actor_hyphen_id = Swift.Int + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/components/parameters/api-insights-min-timestamp`. + public typealias api_hyphen_insights_hyphen_min_hyphen_timestamp = Swift.String + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/components/parameters/api-insights-max-timestamp`. + public typealias api_hyphen_insights_hyphen_max_hyphen_timestamp = Swift.String + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case http_method = "http_method" + case api_route = "api_route" + case total_request_count = "total_request_count" + } + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. + public typealias api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload] + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case subject_name = "subject_name" + case total_request_count = "total_request_count" + } + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias api_hyphen_insights_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_sortPayload] + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/components/parameters/api-insights-user-id`. + public typealias api_hyphen_insights_hyphen_user_hyphen_id = Swift.String + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/components/parameters/api-insights-timestamp-increment`. + public typealias api_hyphen_insights_hyphen_timestamp_hyphen_increment = Swift.String /// The unique identifier of the invitation. /// /// - Remark: Generated from `#/components/parameters/invitation-id`. @@ -10988,22 +11522,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.cursor? - /// - Remark: Generated from `#/paths/orgs/{org}/hooks/{hook_id}/deliveries/GET/query/redelivery`. - public var redelivery: Swift.Bool? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - /// - redelivery: public init( per_page: Components.Parameters.per_hyphen_page? = nil, - cursor: Components.Parameters.cursor? = nil, - redelivery: Swift.Bool? = nil + cursor: Components.Parameters.cursor? = nil ) { self.per_page = per_page self.cursor = cursor - self.redelivery = redelivery } } public var query: Operations.orgs_sol_list_hyphen_webhook_hyphen_deliveries.Input.Query @@ -11694,6 +12223,1687 @@ public enum Operations { } } } + /// Get route stats by actor + /// + /// Get API request count statistics for an actor broken down by route within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)`. + public enum api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor { + public static let id: Swift.String = "api-insights/get-route-stats-by-actor" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/org`. + public var org: Components.Parameters.org + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - actor_type: The type of the actor + /// - actor_id: The ID of the actor + public init( + org: Components.Parameters.org, + actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type, + actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + ) { + self.org = org + self.actor_type = actor_type + self.actor_id = actor_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// 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}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case http_method = "http_method" + case api_route = "api_route" + case total_request_count = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-route-stats-sort`. + public typealias api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/query/sort`. + public var sort: Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + /// - 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)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp, + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + direction: Components.Parameters.direction? = nil, + sort: Components.Parameters.api_hyphen_insights_hyphen_route_hyphen_stats_hyphen_sort? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.page = page + self.per_page = per_page + self.direction = direction + self.sort = sort + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.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}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_route_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_route_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}/get(api-insights/get-route-stats-by-actor)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.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.api_hyphen_insights_sol_get_hyphen_route_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get subject stats + /// + /// Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/subject-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats { + public static let id: Swift.String = "api-insights/get-subject-stats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/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.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// 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}/insights/api/subject-stats/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case subject_name = "subject_name" + case total_request_count = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias api_hyphen_insights_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_sortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/query/sort`. + public var sort: Components.Parameters.api_hyphen_insights_hyphen_sort? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + /// - 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)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp, + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + direction: Components.Parameters.direction? = nil, + sort: Components.Parameters.api_hyphen_insights_hyphen_sort? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.page = page + self.per_page = per_page + self.direction = direction + self.sort = sort + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/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.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.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}/insights/api/subject-stats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/subject-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_subject_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_subject_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/subject-stats/get(api-insights/get-subject-stats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.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.api_hyphen_insights_sol_get_hyphen_subject_hyphen_stats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get summary stats + /// + /// Get overall statistics of API requests made within an organization by all users and apps within a specified time frame. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats { + public static let id: Swift.String = "api-insights/get-summary-stats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.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}/insights/api/summary-stats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_summary_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/get(api-insights/get-summary-stats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get summary stats by user + /// + /// Get overall statistics of API requests within the organization for a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)`. + public enum api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user { + public static let id: Swift.String = "api-insights/get-summary-stats-by-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/org`. + public var org: Components.Parameters.org + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/path/user_id`. + public var user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - user_id: The ID of the user to query for stats + public init( + org: Components.Parameters.org, + user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + ) { + self.org = org + self.user_id = user_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.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}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_summary_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/users/{user_id}/get(api-insights/get-summary-stats-by-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_user.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get summary stats by actor + /// + /// Get overall statistics of API requests within the organization made by a specific actor. Actors can be GitHub App installations, OAuth apps or other tokens on behalf of a user. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)`. + public enum api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor { + public static let id: Swift.String = "api-insights/get-summary-stats-by-actor" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/org`. + public var org: Components.Parameters.org + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - actor_type: The type of the actor + /// - actor_id: The ID of the actor + public init( + org: Components.Parameters.org, + actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type, + actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + ) { + self.org = org + self.actor_type = actor_type + self.actor_id = actor_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.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}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_summary_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_summary_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}/get(api-insights/get-summary-stats-by-actor)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.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.api_hyphen_insights_sol_get_hyphen_summary_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get time stats + /// + /// Get the number of API requests and rate-limited requests made within an organization over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_time_hyphen_stats { + public static let id: Swift.String = "api-insights/get-time-stats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/query/timestamp_increment`. + public var timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + /// - timestamp_increment: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp, + timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.timestamp_increment = timestamp_increment + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.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}/insights/api/time-stats/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_time_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/get(api-insights/get-time-stats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get time stats by user + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/users/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)`. + public enum api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user { + public static let id: Swift.String = "api-insights/get-time-stats-by-user" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/org`. + public var org: Components.Parameters.org + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/path/user_id`. + public var user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - user_id: The ID of the user to query for stats + public init( + org: Components.Parameters.org, + user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + ) { + self.org = org + self.user_id = user_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/query/timestamp_increment`. + public var timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + /// - timestamp_increment: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp, + timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.timestamp_increment = timestamp_increment + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.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}/insights/api/time-stats/users/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/users/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_time_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/users/{user_id}/get(api-insights/get-time-stats-by-user)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_user.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get time stats by actor + /// + /// Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)`. + public enum api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor { + public static let id: Swift.String = "api-insights/get-time-stats-by-actor" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/org`. + public var org: Components.Parameters.org + /// - Remark: Generated from `#/components/parameters/api-insights-actor-type`. + @frozen public enum api_hyphen_insights_hyphen_actor_hyphen_type: String, Codable, Hashable, Sendable { + case installations = "installations" + case classic_pats = "classic_pats" + case fine_grained_pats = "fine_grained_pats" + case oauth_apps = "oauth_apps" + case github_apps_user_to_server = "github_apps_user_to_server" + } + /// The type of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_type`. + public var actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type + /// The ID of the actor + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/path/actor_id`. + public var actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - actor_type: The type of the actor + /// - actor_id: The ID of the actor + public init( + org: Components.Parameters.org, + actor_type: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_type, + actor_id: Components.Parameters.api_hyphen_insights_hyphen_actor_hyphen_id + ) { + self.org = org + self.actor_type = actor_type + self.actor_id = actor_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/query/timestamp_increment`. + public var timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + /// - timestamp_increment: The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp, + timestamp_increment: Components.Parameters.api_hyphen_insights_hyphen_timestamp_hyphen_increment + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.timestamp_increment = timestamp_increment + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.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}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_time_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_time_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}/get(api-insights/get-time-stats-by-actor)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.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.api_hyphen_insights_sol_get_hyphen_time_hyphen_stats_hyphen_by_hyphen_actor.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } + /// Get user stats + /// + /// Get API usage statistics within an organization for a user broken down by the type of access. + /// + /// - Remark: HTTP `GET /orgs/{org}/insights/api/user-stats/{user_id}`. + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)`. + public enum api_hyphen_insights_sol_get_hyphen_user_hyphen_stats { + public static let id: Swift.String = "api-insights/get-user-stats" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path`. + public struct Path: Sendable, Hashable { + /// The organization name. The name is not case sensitive. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/org`. + public var org: Components.Parameters.org + /// The ID of the user to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/path/user_id`. + public var user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + /// Creates a new `Path`. + /// + /// - Parameters: + /// - org: The organization name. The name is not case sensitive. + /// - user_id: The ID of the user to query for stats + public init( + org: Components.Parameters.org, + user_id: Components.Parameters.api_hyphen_insights_hyphen_user_hyphen_id + ) { + self.org = org + self.user_id = user_id + } + } + public var path: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Path + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query`. + public struct Query: Sendable, Hashable { + /// The minimum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/min_timestamp`. + public var min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp + /// The maximum timestamp to query for stats + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/max_timestamp`. + public var max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp + /// 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}/insights/api/user-stats/{user_id}/GET/query/page`. + public var page: Components.Parameters.page? + /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/per_page`. + public var per_page: Components.Parameters.per_hyphen_page? + /// - Remark: Generated from `#/components/parameters/direction`. + @frozen public enum direction: String, Codable, Hashable, Sendable { + case asc = "asc" + case desc = "desc" + } + /// The direction to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/direction`. + public var direction: Components.Parameters.direction? + /// - Remark: Generated from `#/components/parameters/api_hyphen_insights_hyphen_sort`. + @frozen public enum api_hyphen_insights_hyphen_sortPayload: String, Codable, Hashable, Sendable { + case last_rate_limited_timestamp = "last_rate_limited_timestamp" + case last_request_timestamp = "last_request_timestamp" + case rate_limited_request_count = "rate_limited_request_count" + case subject_name = "subject_name" + case total_request_count = "total_request_count" + } + /// - Remark: Generated from `#/components/parameters/api-insights-sort`. + public typealias api_hyphen_insights_hyphen_sort = [Components.Parameters.api_hyphen_insights_hyphen_sortPayload] + /// The property to sort the results by. + /// + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/query/sort`. + public var sort: Components.Parameters.api_hyphen_insights_hyphen_sort? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - min_timestamp: The minimum timestamp to query for stats + /// - max_timestamp: The maximum timestamp to query for stats + /// - 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)." + /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + /// - direction: The direction to sort the results by. + /// - sort: The property to sort the results by. + public init( + min_timestamp: Components.Parameters.api_hyphen_insights_hyphen_min_hyphen_timestamp, + max_timestamp: Components.Parameters.api_hyphen_insights_hyphen_max_hyphen_timestamp, + page: Components.Parameters.page? = nil, + per_page: Components.Parameters.per_hyphen_page? = nil, + direction: Components.Parameters.direction? = nil, + sort: Components.Parameters.api_hyphen_insights_hyphen_sort? = nil + ) { + self.min_timestamp = min_timestamp + self.max_timestamp = max_timestamp + self.page = page + self.per_page = per_page + self.direction = direction + self.sort = sort + } + } + public var query: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Query + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Path, + query: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Input.Query, + headers: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.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}/insights/api/user-stats/{user_id}/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/orgs/{org}/insights/api/user-stats/{user_id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.api_hyphen_insights_hyphen_user_hyphen_stats) + /// 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.api_hyphen_insights_hyphen_user_hyphen_stats { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok.Body) { + self.body = body + } + } + /// Response + /// + /// - Remark: Generated from `#/paths//orgs/{org}/insights/api/user-stats/{user_id}/get(api-insights/get-user-stats)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.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.api_hyphen_insights_sol_get_hyphen_user_hyphen_stats.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + } + } + public static var allCases: [Self] { + [ + .json + ] + } + } + } /// List app installations for an organization /// /// Lists all GitHub Apps in an organization. The installation count includes diff --git a/Sources/packages/Client.swift b/Sources/packages/Client.swift index 05b645285f8..e5046653064 100644 --- a/Sources/packages/Client.swift +++ b/Sources/packages/Client.swift @@ -152,7 +152,7 @@ public struct Client: APIProtocol { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -292,7 +292,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -362,7 +362,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -482,7 +482,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -603,7 +603,7 @@ public struct Client: APIProtocol { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -758,7 +758,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -829,7 +829,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -950,7 +950,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -1129,7 +1129,7 @@ public struct Client: APIProtocol { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -1223,7 +1223,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -1290,7 +1290,7 @@ public struct Client: APIProtocol { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -1407,7 +1407,7 @@ public struct Client: APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -1527,7 +1527,7 @@ public struct Client: APIProtocol { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -1681,7 +1681,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -1751,7 +1751,7 @@ public struct Client: APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -1869,7 +1869,7 @@ public struct Client: APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -2093,7 +2093,7 @@ public struct Client: APIProtocol { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -2233,7 +2233,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -2303,7 +2303,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -2423,7 +2423,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -2544,7 +2544,7 @@ public struct Client: APIProtocol { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -2678,7 +2678,7 @@ public struct Client: APIProtocol { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -2749,7 +2749,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -2870,7 +2870,7 @@ public struct Client: APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. diff --git a/Sources/packages/Types.swift b/Sources/packages/Types.swift index fd5d57efb80..d3603767eed 100644 --- a/Sources/packages/Types.swift +++ b/Sources/packages/Types.swift @@ -24,7 +24,7 @@ public protocol APIProtocol: Sendable { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -33,7 +33,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -44,7 +44,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -59,7 +59,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -68,7 +68,7 @@ public protocol APIProtocol: Sendable { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -77,7 +77,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -88,7 +88,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -103,7 +103,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -121,7 +121,7 @@ public protocol APIProtocol: Sendable { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -130,7 +130,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -139,7 +139,7 @@ public protocol APIProtocol: Sendable { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -152,7 +152,7 @@ public protocol APIProtocol: Sendable { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -161,7 +161,7 @@ public protocol APIProtocol: Sendable { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -170,7 +170,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -181,7 +181,7 @@ public protocol APIProtocol: Sendable { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -194,7 +194,7 @@ public protocol APIProtocol: Sendable { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -212,7 +212,7 @@ public protocol APIProtocol: Sendable { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -221,7 +221,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -232,7 +232,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -247,7 +247,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -256,7 +256,7 @@ public protocol APIProtocol: Sendable { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -265,7 +265,7 @@ public protocol APIProtocol: Sendable { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -276,7 +276,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -291,7 +291,7 @@ public protocol APIProtocol: Sendable { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. @@ -321,7 +321,7 @@ extension APIProtocol { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -340,7 +340,7 @@ extension APIProtocol { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -359,7 +359,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -382,7 +382,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -401,7 +401,7 @@ extension APIProtocol { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -420,7 +420,7 @@ extension APIProtocol { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -439,7 +439,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -462,7 +462,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -490,7 +490,7 @@ extension APIProtocol { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -507,7 +507,7 @@ extension APIProtocol { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -524,7 +524,7 @@ extension APIProtocol { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -545,7 +545,7 @@ extension APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -564,7 +564,7 @@ extension APIProtocol { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -583,7 +583,7 @@ extension APIProtocol { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -602,7 +602,7 @@ extension APIProtocol { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -623,7 +623,7 @@ extension APIProtocol { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -657,7 +657,7 @@ extension APIProtocol { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -676,7 +676,7 @@ extension APIProtocol { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -695,7 +695,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -718,7 +718,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -737,7 +737,7 @@ extension APIProtocol { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -754,7 +754,7 @@ extension APIProtocol { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -773,7 +773,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -796,7 +796,7 @@ extension APIProtocol { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. @@ -2572,7 +2572,7 @@ public enum Operations { /// /// Lists packages in an organization readable by the user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/get(packages/list-packages-for-organization)`. @@ -2834,7 +2834,7 @@ public enum Operations { /// /// Gets a specific package in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/get(packages/get-package-for-organization)`. @@ -2995,7 +2995,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-org)`. @@ -3205,7 +3205,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-org)`. @@ -3427,7 +3427,7 @@ public enum Operations { /// /// Lists package versions for a package owned by an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-org)`. @@ -3694,7 +3694,7 @@ public enum Operations { /// /// Gets a specific package version in an organization. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-organization)`. @@ -3862,7 +3862,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-org)`. @@ -4079,7 +4079,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-org)`. @@ -4404,7 +4404,7 @@ public enum Operations { /// /// Lists packages owned by the authenticated user within the user's namespace. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages`. /// - Remark: Generated from `#/paths//user/packages/get(packages/list-packages-for-authenticated-user)`. @@ -4602,7 +4602,7 @@ public enum Operations { /// /// Gets a specific package for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/get(packages/get-package-for-authenticated-user)`. @@ -4754,7 +4754,7 @@ public enum Operations { /// /// Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/delete(packages/delete-package-for-authenticated-user)`. @@ -4955,7 +4955,7 @@ public enum Operations { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-authenticated-user)`. @@ -5170,7 +5170,7 @@ public enum Operations { /// /// Lists package versions for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-authenticated-user)`. @@ -5430,7 +5430,7 @@ public enum Operations { /// /// Gets a specific package version for a package owned by the authenticated user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-authenticated-user)`. @@ -5591,7 +5591,7 @@ public enum Operations { /// /// The authenticated user must have admin permissions in the organization to use this endpoint. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-authenticated-user)`. @@ -5799,7 +5799,7 @@ public enum Operations { /// - The package was deleted within the last 30 days. /// - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-authenticated-user)`. @@ -6183,7 +6183,7 @@ public enum Operations { /// /// Lists all packages in a user's namespace for which the requesting user has access. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages`. /// - Remark: Generated from `#/paths//users/{username}/packages/get(packages/list-packages-for-user)`. @@ -6445,7 +6445,7 @@ public enum Operations { /// /// Gets a specific package metadata for a public package owned by a user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/get(packages/get-package-for-user)`. @@ -6606,7 +6606,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/delete(packages/delete-package-for-user)`. @@ -6816,7 +6816,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/restore/post(packages/restore-package-for-user)`. @@ -7038,7 +7038,7 @@ public enum Operations { /// /// Lists package versions for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/get(packages/get-all-package-versions-for-package-owned-by-user)`. @@ -7266,7 +7266,7 @@ public enum Operations { /// /// Gets a specific package version for a public package owned by a specified user. /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/get(packages/get-package-version-for-user)`. @@ -7434,7 +7434,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/delete(packages/delete-package-version-for-user)`. @@ -7651,7 +7651,7 @@ public enum Operations { /// /// If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." /// - /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." + /// OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. For more information, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." /// /// - Remark: HTTP `POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore`. /// - Remark: Generated from `#/paths//users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore/post(packages/restore-package-version-for-user)`. diff --git a/Sources/repos/Client.swift b/Sources/repos/Client.swift index c5e569e6e21..5dfc5c51512 100644 --- a/Sources/repos/Client.swift +++ b/Sources/repos/Client.swift @@ -11730,13 +11730,6 @@ public struct Client: APIProtocol { name: "cursor", value: input.query.cursor ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "redelivery", - value: input.query.redelivery - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept diff --git a/Sources/repos/Types.swift b/Sources/repos/Types.swift index 2491f48000d..c63ec4e96bc 100644 --- a/Sources/repos/Types.swift +++ b/Sources/repos/Types.swift @@ -47455,22 +47455,17 @@ public enum Operations { /// /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/GET/query/cursor`. public var cursor: Components.Parameters.cursor? - /// - Remark: Generated from `#/paths/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/GET/query/redelivery`. - public var redelivery: Swift.Bool? /// Creates a new `Query`. /// /// - Parameters: /// - per_page: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." /// - cursor: Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. - /// - redelivery: public init( per_page: Components.Parameters.per_hyphen_page? = nil, - cursor: Components.Parameters.cursor? = nil, - redelivery: Swift.Bool? = nil + cursor: Components.Parameters.cursor? = nil ) { self.per_page = per_page self.cursor = cursor - self.redelivery = redelivery } } public var query: Operations.repos_sol_list_hyphen_webhook_hyphen_deliveries.Input.Query diff --git a/Sources/users/Client.swift b/Sources/users/Client.swift index 61359f3a9e4..03227230960 100644 --- a/Sources/users/Client.swift +++ b/Sources/users/Client.swift @@ -1907,6 +1907,28 @@ public struct Client: APIProtocol { preconditionFailure("bestContentType chose an invalid content type.") } return .unauthorized(.init(body: body)) + case 422: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Components.Responses.validation_failed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.validation_hyphen_error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unprocessableContent(.init(body: body)) default: return .undocumented( statusCode: response.status.code, diff --git a/Sources/users/Types.swift b/Sources/users/Types.swift index 1c5f2066824..2b2c7e469d7 100644 --- a/Sources/users/Types.swift +++ b/Sources/users/Types.swift @@ -6475,6 +6475,29 @@ public enum Operations { } } } + /// Validation failed, or the endpoint has been spammed. + /// + /// - Remark: Generated from `#/paths//user/following/{username}/put(users/follow)/responses/422`. + /// + /// HTTP response code: `422 unprocessableContent`. + case unprocessableContent(Components.Responses.validation_failed) + /// The associated value of the enum case if `self` is `.unprocessableContent`. + /// + /// - Throws: An error if `self` is not `.unprocessableContent`. + /// - SeeAlso: `.unprocessableContent`. + public var unprocessableContent: Components.Responses.validation_failed { + get throws { + switch self { + case let .unprocessableContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unprocessableContent", + response: self + ) + } + } + } /// Undocumented response. /// /// A response with a code that is not documented in the OpenAPI document. diff --git a/Submodule/github/rest-api-description b/Submodule/github/rest-api-description index 531ec66f506..10e2f151b45 160000 --- a/Submodule/github/rest-api-description +++ b/Submodule/github/rest-api-description @@ -1 +1 @@ -Subproject commit 531ec66f506b4a24468ca33192dc1ca5489f8a1b +Subproject commit 10e2f151b45a960f135417e71bd6f0ac5ce0aa97