Skip to content

Commit 722db35

Browse files
Merge pull request #56 from Wei18/dependabot/submodules/Submodule/github/rest-api-description-4adfd3e
Bump Submodule/github/rest-api-description from `e04c0a4` to `4adfd3e`
2 parents 8b29ee2 + 99cf7ea commit 722db35

File tree

11 files changed

+189
-45
lines changed

11 files changed

+189
-45
lines changed

.spi.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ builder:
99
- GitHubRestAPIChecks
1010
- GitHubRestAPIClassroom
1111
- GitHubRestAPICode_Scanning
12+
- GitHubRestAPICode_Security
1213
- GitHubRestAPICodes_Of_Conduct
1314
- GitHubRestAPICodespaces
1415
- GitHubRestAPICopilot

Package.swift

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ let package = Package(
1818
.library(name: "GitHubRestAPIChecks", targets: ["GitHubRestAPIChecks"]),
1919
.library(name: "GitHubRestAPIClassroom", targets: ["GitHubRestAPIClassroom"]),
2020
.library(name: "GitHubRestAPICode_Scanning", targets: ["GitHubRestAPICode_Scanning"]),
21+
.library(name: "GitHubRestAPICode_Security", targets: ["GitHubRestAPICode_Security"]),
2122
.library(name: "GitHubRestAPICodes_Of_Conduct", targets: ["GitHubRestAPICodes_Of_Conduct"]),
2223
.library(name: "GitHubRestAPICodespaces", targets: ["GitHubRestAPICodespaces"]),
2324
.library(name: "GitHubRestAPICopilot", targets: ["GitHubRestAPICopilot"]),
@@ -111,6 +112,14 @@ let package = Package(
111112
],
112113
path: "Sources/code-scanning"
113114
),
115+
.target(
116+
name: "GitHubRestAPICode_Security",
117+
dependencies: [
118+
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
119+
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
120+
],
121+
path: "Sources/code-security"
122+
),
114123
.target(
115124
name: "GitHubRestAPICodes_Of_Conduct",
116125
dependencies: [

Sources/code-security/Client.swift

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Generated by swift-openapi-generator, do not modify.
2+
@_spi(Generated) import OpenAPIRuntime
3+
#if os(Linux)
4+
@preconcurrency import struct Foundation.URL
5+
@preconcurrency import struct Foundation.Data
6+
@preconcurrency import struct Foundation.Date
7+
#else
8+
import struct Foundation.URL
9+
import struct Foundation.Data
10+
import struct Foundation.Date
11+
#endif
12+
import HTTPTypes
13+
/// GitHub's v3 REST API.
14+
public struct Client: APIProtocol {
15+
/// The underlying HTTP client.
16+
private let client: UniversalClient
17+
/// Creates a new client.
18+
/// - Parameters:
19+
/// - serverURL: The server URL that the client connects to. Any server
20+
/// URLs defined in the OpenAPI document are available as static methods
21+
/// on the ``Servers`` type.
22+
/// - configuration: A set of configuration values for the client.
23+
/// - transport: A transport that performs HTTP operations.
24+
/// - middlewares: A list of middlewares to call before the transport.
25+
public init(
26+
serverURL: Foundation.URL,
27+
configuration: Configuration = .init(),
28+
transport: any ClientTransport,
29+
middlewares: [any ClientMiddleware] = []
30+
) {
31+
self.client = .init(
32+
serverURL: serverURL,
33+
configuration: configuration,
34+
transport: transport,
35+
middlewares: middlewares
36+
)
37+
}
38+
private var converter: Converter {
39+
client.converter
40+
}
41+
}

Sources/code-security/Types.swift

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Generated by swift-openapi-generator, do not modify.
2+
@_spi(Generated) import OpenAPIRuntime
3+
#if os(Linux)
4+
@preconcurrency import struct Foundation.URL
5+
@preconcurrency import struct Foundation.Data
6+
@preconcurrency import struct Foundation.Date
7+
#else
8+
import struct Foundation.URL
9+
import struct Foundation.Data
10+
import struct Foundation.Date
11+
#endif
12+
/// A type that performs HTTP operations defined by the OpenAPI document.
13+
public protocol APIProtocol: Sendable {}
14+
15+
/// Convenience overloads for operation inputs.
16+
extension APIProtocol {
17+
}
18+
19+
/// Server URLs defined in the OpenAPI document.
20+
public enum Servers {
21+
public static func server1() throws -> Foundation.URL {
22+
try Foundation.URL(
23+
validatingOpenAPIServerURL: "https://api.github.com",
24+
variables: []
25+
)
26+
}
27+
}
28+
29+
/// Types generated from the components section of the OpenAPI document.
30+
public enum Components {
31+
/// Types generated from the `#/components/schemas` section of the OpenAPI document.
32+
public enum Schemas {}
33+
/// Types generated from the `#/components/parameters` section of the OpenAPI document.
34+
public enum Parameters {}
35+
/// Types generated from the `#/components/requestBodies` section of the OpenAPI document.
36+
public enum RequestBodies {}
37+
/// Types generated from the `#/components/responses` section of the OpenAPI document.
38+
public enum Responses {}
39+
/// Types generated from the `#/components/headers` section of the OpenAPI document.
40+
public enum Headers {}
41+
}
42+
43+
/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document.
44+
public enum Operations {}

Sources/copilot/Client.swift

+4-6
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ public struct Client: APIProtocol {
5050
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
5151
/// they must have telemetry enabled in their IDE.
5252
///
53-
/// Only the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
54-
/// metrics for the enterprise.
53+
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
5554
///
56-
/// 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.
55+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
5756
///
5857
/// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`.
5958
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
@@ -1281,10 +1280,9 @@ public struct Client: APIProtocol {
12811280
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
12821281
/// they must have telemetry enabled in their IDE.
12831282
///
1284-
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
1285-
/// Copilot usage metrics.
1283+
/// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.
12861284
///
1287-
/// 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.
1285+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
12881286
///
12891287
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
12901288
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.

Sources/copilot/Types.swift

+12-18
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ public protocol APIProtocol: Sendable {
2323
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
2424
/// they must have telemetry enabled in their IDE.
2525
///
26-
/// Only the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
27-
/// metrics for the enterprise.
26+
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
2827
///
29-
/// 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.
28+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
3029
///
3130
/// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`.
3231
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
@@ -143,10 +142,9 @@ public protocol APIProtocol: Sendable {
143142
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
144143
/// they must have telemetry enabled in their IDE.
145144
///
146-
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
147-
/// Copilot usage metrics.
145+
/// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.
148146
///
149-
/// 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.
147+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
150148
///
151149
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
152150
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.
@@ -180,10 +178,9 @@ extension APIProtocol {
180178
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
181179
/// they must have telemetry enabled in their IDE.
182180
///
183-
/// Only the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
184-
/// metrics for the enterprise.
181+
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
185182
///
186-
/// 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.
183+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
187184
///
188185
/// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`.
189186
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
@@ -368,10 +365,9 @@ extension APIProtocol {
368365
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
369366
/// they must have telemetry enabled in their IDE.
370367
///
371-
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
372-
/// Copilot usage metrics.
368+
/// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.
373369
///
374-
/// 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.
370+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
375371
///
376372
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
377373
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.
@@ -1959,10 +1955,9 @@ public enum Operations {
19591955
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
19601956
/// they must have telemetry enabled in their IDE.
19611957
///
1962-
/// Only the owners and billing managers of enterprises with a Copilot Business or Enterprise subscription can view Copilot usage
1963-
/// metrics for the enterprise.
1958+
/// Only owners and billing managers can view Copilot usage metrics for the enterprise.
19641959
///
1965-
/// 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.
1960+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint.
19661961
///
19671962
/// - Remark: HTTP `GET /enterprises/{enterprise}/copilot/usage`.
19681963
/// - Remark: Generated from `#/paths//enterprises/{enterprise}/copilot/usage/get(copilot/usage-metrics-for-enterprise)`.
@@ -4017,10 +4012,9 @@ public enum Operations {
40174012
/// and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
40184013
/// they must have telemetry enabled in their IDE.
40194014
///
4020-
/// Copilot Business or Copilot Enterprise organization owners, and owners and billing managers of their parent enterprises, can view
4021-
/// Copilot usage metrics.
4015+
/// Organization owners, and owners and billing managers of the parent enterprise, can view Copilot usage metrics.
40224016
///
4023-
/// 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.
4017+
/// OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
40244018
///
40254019
/// - Remark: HTTP `GET /orgs/{org}/copilot/usage`.
40264020
/// - Remark: Generated from `#/paths//orgs/{org}/copilot/usage/get(copilot/usage-metrics-for-org)`.

Sources/orgs/Client.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,10 @@ public struct Client: APIProtocol {
20842084
}
20852085
/// List pending organization invitations
20862086
///
2087-
/// 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`.
2087+
/// The return hash contains a `role` field which refers to the Organization
2088+
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
2089+
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
2090+
/// member, the `login` field in the return hash will be `null`.
20882091
///
20892092
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
20902093
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.

Sources/orgs/Types.swift

+12-3
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ public protocol APIProtocol: Sendable {
266266
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
267267
/// List pending organization invitations
268268
///
269-
/// 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`.
269+
/// The return hash contains a `role` field which refers to the Organization
270+
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
271+
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
272+
/// member, the `login` field in the return hash will be `null`.
270273
///
271274
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
272275
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.
@@ -1242,7 +1245,10 @@ extension APIProtocol {
12421245
}
12431246
/// List pending organization invitations
12441247
///
1245-
/// 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`.
1248+
/// The return hash contains a `role` field which refers to the Organization
1249+
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
1250+
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
1251+
/// member, the `login` field in the return hash will be `null`.
12461252
///
12471253
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
12481254
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.
@@ -11384,7 +11390,10 @@ public enum Operations {
1138411390
}
1138511391
/// List pending organization invitations
1138611392
///
11387-
/// 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`.
11393+
/// The return hash contains a `role` field which refers to the Organization
11394+
/// Invitation role and will be one of the following values: `direct_member`, `admin`,
11395+
/// `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
11396+
/// member, the `login` field in the return hash will be `null`.
1138811397
///
1138911398
/// - Remark: HTTP `GET /orgs/{org}/invitations`.
1139011399
/// - Remark: Generated from `#/paths//orgs/{org}/invitations/get(orgs/list-pending-invitations)`.

0 commit comments

Comments
 (0)