Skip to content

Commit ec31d64

Browse files
Commit via running ake Sources/code-security
1 parent 882b894 commit ec31d64

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

Sources/code-security/Client.swift

Lines changed: 41 additions & 0 deletions
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

Lines changed: 44 additions & 0 deletions
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 {}

0 commit comments

Comments
 (0)