Skip to content

Bump Submodule/github/rest-api-description from e04c0a4 to 4adfd3e #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ builder:
- GitHubRestAPIChecks
- GitHubRestAPIClassroom
- GitHubRestAPICode_Scanning
- GitHubRestAPICode_Security
- GitHubRestAPICodes_Of_Conduct
- GitHubRestAPICodespaces
- GitHubRestAPICopilot
Expand Down
9 changes: 9 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let package = Package(
.library(name: "GitHubRestAPIChecks", targets: ["GitHubRestAPIChecks"]),
.library(name: "GitHubRestAPIClassroom", targets: ["GitHubRestAPIClassroom"]),
.library(name: "GitHubRestAPICode_Scanning", targets: ["GitHubRestAPICode_Scanning"]),
.library(name: "GitHubRestAPICode_Security", targets: ["GitHubRestAPICode_Security"]),
.library(name: "GitHubRestAPICodes_Of_Conduct", targets: ["GitHubRestAPICodes_Of_Conduct"]),
.library(name: "GitHubRestAPICodespaces", targets: ["GitHubRestAPICodespaces"]),
.library(name: "GitHubRestAPICopilot", targets: ["GitHubRestAPICopilot"]),
Expand Down Expand Up @@ -111,6 +112,14 @@ let package = Package(
],
path: "Sources/code-scanning"
),
.target(
name: "GitHubRestAPICode_Security",
dependencies: [
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
],
path: "Sources/code-security"
),
.target(
name: "GitHubRestAPICodes_Of_Conduct",
dependencies: [
Expand Down
41 changes: 41 additions & 0 deletions Sources/code-security/Client.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Generated by swift-openapi-generator, do not modify.
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
@preconcurrency import struct Foundation.Date
#else
import struct Foundation.URL
import struct Foundation.Data
import struct Foundation.Date
#endif
import HTTPTypes
/// GitHub's v3 REST API.
public struct Client: APIProtocol {
/// The underlying HTTP client.
private let client: UniversalClient
/// Creates a new client.
/// - Parameters:
/// - serverURL: The server URL that the client connects to. Any server
/// URLs defined in the OpenAPI document are available as static methods
/// on the ``Servers`` type.
/// - configuration: A set of configuration values for the client.
/// - transport: A transport that performs HTTP operations.
/// - middlewares: A list of middlewares to call before the transport.
public init(
serverURL: Foundation.URL,
configuration: Configuration = .init(),
transport: any ClientTransport,
middlewares: [any ClientMiddleware] = []
) {
self.client = .init(
serverURL: serverURL,
configuration: configuration,
transport: transport,
middlewares: middlewares
)
}
private var converter: Converter {
client.converter
}
}
44 changes: 44 additions & 0 deletions Sources/code-security/Types.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Generated by swift-openapi-generator, do not modify.
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
@preconcurrency import struct Foundation.Date
#else
import struct Foundation.URL
import struct Foundation.Data
import struct Foundation.Date
#endif
/// A type that performs HTTP operations defined by the OpenAPI document.
public protocol APIProtocol: Sendable {}

/// Convenience overloads for operation inputs.
extension APIProtocol {
}

/// Server URLs defined in the OpenAPI document.
public enum Servers {
public static func server1() throws -> Foundation.URL {
try Foundation.URL(
validatingOpenAPIServerURL: "https://api.github.com",
variables: []
)
}
}

/// Types generated from the components section of the OpenAPI document.
public enum Components {
/// Types generated from the `#/components/schemas` section of the OpenAPI document.
public enum Schemas {}
/// Types generated from the `#/components/parameters` section of the OpenAPI document.
public enum Parameters {}
/// Types generated from the `#/components/requestBodies` section of the OpenAPI document.
public enum RequestBodies {}
/// Types generated from the `#/components/responses` section of the OpenAPI document.
public enum Responses {}
/// Types generated from the `#/components/headers` section of the OpenAPI document.
public enum Headers {}
}

/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document.
public enum Operations {}
10 changes: 4 additions & 6 deletions Sources/copilot/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ public struct Client: APIProtocol {
/// 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 the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
/// metrics for the enterprise.
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
///
/// OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:enterprise`, or `manage_billing:enterprise` scope 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/usage`.
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
Expand Down Expand Up @@ -1281,10 +1280,9 @@ public struct Client: APIProtocol {
/// 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.
///
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
/// Copilot usage metrics.
/// 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 the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint.
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.
Expand Down
30 changes: 12 additions & 18 deletions Sources/copilot/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ public protocol APIProtocol: Sendable {
/// 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 the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
/// metrics for the enterprise.
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
///
/// OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:enterprise`, or `manage_billing:enterprise` scope 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/usage`.
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
Expand Down Expand Up @@ -143,10 +142,9 @@ public protocol APIProtocol: Sendable {
/// 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.
///
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
/// Copilot usage metrics.
/// 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 the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint.
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.
Expand Down Expand Up @@ -180,10 +178,9 @@ extension APIProtocol {
/// 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 the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
/// metrics for the enterprise.
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
///
/// OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:enterprise`, or `manage_billing:enterprise` scope 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/usage`.
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
Expand Down Expand Up @@ -368,10 +365,9 @@ extension APIProtocol {
/// 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.
///
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
/// Copilot usage metrics.
/// 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 the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint.
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.
Expand Down Expand Up @@ -1959,10 +1955,9 @@ public enum Operations {
/// 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 the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
/// metrics for the enterprise.
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
///
/// OAuth app tokens and personal access tokens (classic) need the `copilot`, `manage_billing:copilot`, `admin:enterprise`, or `manage_billing:enterprise` scope 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/usage`.
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
Expand Down Expand Up @@ -4017,10 +4012,9 @@ public enum Operations {
/// 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.
///
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
/// Copilot usage metrics.
/// 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 the `copilot`, `manage_billing:copilot`, `admin:org`, `admin:enterprise`, or `manage_billing:enterprise` scope to use this endpoint.
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.
Expand Down
5 changes: 4 additions & 1 deletion Sources/orgs/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,10 @@ public struct Client: APIProtocol {
}
/// List pending organization invitations
///
/// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.
/// The return hash contains a `role` field which refers to the Organization
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
/// member, the `login` field in the return hash will be `null`.
///
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.
Expand Down
15 changes: 12 additions & 3 deletions Sources/orgs/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ public protocol APIProtocol: Sendable {
func orgs_sol_list_hyphen_app_hyphen_installations(_ input: Operations.orgs_sol_list_hyphen_app_hyphen_installations.Input) async throws -> Operations.orgs_sol_list_hyphen_app_hyphen_installations.Output
/// List pending organization invitations
///
/// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.
/// The return hash contains a `role` field which refers to the Organization
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
/// member, the `login` field in the return hash will be `null`.
///
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.
Expand Down Expand Up @@ -1242,7 +1245,10 @@ extension APIProtocol {
}
/// List pending organization invitations
///
/// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.
/// The return hash contains a `role` field which refers to the Organization
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
/// member, the `login` field in the return hash will be `null`.
///
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.
Expand Down Expand Up @@ -11384,7 +11390,10 @@ public enum Operations {
}
/// List pending organization invitations
///
/// The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.
/// The return hash contains a `role` field which refers to the Organization
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
/// member, the `login` field in the return hash will be `null`.
///
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.
Expand Down
Loading