@@ -10,7 +10,7 @@ import struct Foundation.Data
10
10
import struct Foundation. Date
11
11
#endif
12
12
/// A type that performs HTTP operations defined by the OpenAPI document.
13
- package protocol APIProtocol : Sendable {
13
+ internal protocol APIProtocol : Sendable {
14
14
/// - Remark: HTTP `GET /greet`.
15
15
/// - Remark: Generated from `#/paths//greet/get(getGreeting)`.
16
16
func getGreeting( _ input: Operations . getGreeting . Input ) async throws -> Operations . getGreeting . Output
@@ -20,7 +20,7 @@ package protocol APIProtocol: Sendable {
20
20
extension APIProtocol {
21
21
/// - Remark: HTTP `GET /greet`.
22
22
/// - Remark: Generated from `#/paths//greet/get(getGreeting)`.
23
- package func getGreeting(
23
+ internal func getGreeting(
24
24
query: Operations . getGreeting . Input . Query = . init( ) ,
25
25
headers: Operations . getGreeting . Input . Headers = . init( )
26
26
) async throws -> Operations . getGreeting . Output {
@@ -32,9 +32,20 @@ extension APIProtocol {
32
32
}
33
33
34
34
/// Server URLs defined in the OpenAPI document.
35
- package enum Servers {
35
+ internal enum Servers {
36
36
/// Example service deployment.
37
- package static func server1( ) throws -> Foundation . URL {
37
+ internal enum Server1 {
38
+ /// Example service deployment.
39
+ internal static func url( ) throws -> Foundation . URL {
40
+ try Foundation . URL (
41
+ validatingOpenAPIServerURL: " https://example.com/api " ,
42
+ variables: [ ]
43
+ )
44
+ }
45
+ }
46
+ /// Example service deployment.
47
+ @available ( * , deprecated, renamed: " Servers.Server1.url " )
48
+ internal static func server1( ) throws -> Foundation . URL {
38
49
try Foundation . URL (
39
50
validatingOpenAPIServerURL: " https://example.com/api " ,
40
51
variables: [ ]
@@ -43,97 +54,97 @@ package enum Servers {
43
54
}
44
55
45
56
/// Types generated from the components section of the OpenAPI document.
46
- package enum Components {
57
+ internal enum Components {
47
58
/// Types generated from the `#/components/schemas` section of the OpenAPI document.
48
- package enum Schemas {
59
+ internal enum Schemas {
49
60
/// A value with the greeting contents.
50
61
///
51
62
/// - Remark: Generated from `#/components/schemas/Greeting`.
52
- package struct Greeting : Codable , Hashable , Sendable {
63
+ internal struct Greeting : Codable , Hashable , Sendable {
53
64
/// The string representation of the greeting.
54
65
///
55
66
/// - Remark: Generated from `#/components/schemas/Greeting/message`.
56
- package var message : Swift . String
67
+ internal var message : Swift . String
57
68
/// Creates a new `Greeting`.
58
69
///
59
70
/// - Parameters:
60
71
/// - message: The string representation of the greeting.
61
- package init ( message: Swift . String ) {
72
+ internal init ( message: Swift . String ) {
62
73
self . message = message
63
74
}
64
- package enum CodingKeys : String , CodingKey {
75
+ internal enum CodingKeys : String , CodingKey {
65
76
case message
66
77
}
67
78
}
68
79
}
69
80
/// Types generated from the `#/components/parameters` section of the OpenAPI document.
70
- package enum Parameters { }
81
+ internal enum Parameters { }
71
82
/// Types generated from the `#/components/requestBodies` section of the OpenAPI document.
72
- package enum RequestBodies { }
83
+ internal enum RequestBodies { }
73
84
/// Types generated from the `#/components/responses` section of the OpenAPI document.
74
- package enum Responses { }
85
+ internal enum Responses { }
75
86
/// Types generated from the `#/components/headers` section of the OpenAPI document.
76
- package enum Headers { }
87
+ internal enum Headers { }
77
88
}
78
89
79
90
/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document.
80
- package enum Operations {
91
+ internal enum Operations {
81
92
/// - Remark: HTTP `GET /greet`.
82
93
/// - Remark: Generated from `#/paths//greet/get(getGreeting)`.
83
- package enum getGreeting {
84
- package static let id : Swift . String = " getGreeting "
85
- package struct Input : Sendable , Hashable {
94
+ internal enum getGreeting {
95
+ internal static let id : Swift . String = " getGreeting "
96
+ internal struct Input : Sendable , Hashable {
86
97
/// - Remark: Generated from `#/paths/greet/GET/query`.
87
- package struct Query : Sendable , Hashable {
98
+ internal struct Query : Sendable , Hashable {
88
99
/// The name used in the returned greeting.
89
100
///
90
101
/// - Remark: Generated from `#/paths/greet/GET/query/name`.
91
- package var name : Swift . String ?
102
+ internal var name : Swift . String ?
92
103
/// Creates a new `Query`.
93
104
///
94
105
/// - Parameters:
95
106
/// - name: The name used in the returned greeting.
96
- package init ( name: Swift . String ? = nil ) {
107
+ internal init ( name: Swift . String ? = nil ) {
97
108
self . name = name
98
109
}
99
110
}
100
- package var query : Operations . getGreeting . Input . Query
111
+ internal var query : Operations . getGreeting . Input . Query
101
112
/// - Remark: Generated from `#/paths/greet/GET/header`.
102
- package struct Headers : Sendable , Hashable {
103
- package var accept : [ OpenAPIRuntime . AcceptHeaderContentType < Operations . getGreeting . AcceptableContentType > ]
113
+ internal struct Headers : Sendable , Hashable {
114
+ internal var accept : [ OpenAPIRuntime . AcceptHeaderContentType < Operations . getGreeting . AcceptableContentType > ]
104
115
/// Creates a new `Headers`.
105
116
///
106
117
/// - Parameters:
107
118
/// - accept:
108
- package init ( accept: [ OpenAPIRuntime . AcceptHeaderContentType < Operations . getGreeting . AcceptableContentType > ] = . defaultValues( ) ) {
119
+ internal init ( accept: [ OpenAPIRuntime . AcceptHeaderContentType < Operations . getGreeting . AcceptableContentType > ] = . defaultValues( ) ) {
109
120
self . accept = accept
110
121
}
111
122
}
112
- package var headers : Operations . getGreeting . Input . Headers
123
+ internal var headers : Operations . getGreeting . Input . Headers
113
124
/// Creates a new `Input`.
114
125
///
115
126
/// - Parameters:
116
127
/// - query:
117
128
/// - headers:
118
- package init (
129
+ internal init (
119
130
query: Operations . getGreeting . Input . Query = . init( ) ,
120
131
headers: Operations . getGreeting . Input . Headers = . init( )
121
132
) {
122
133
self . query = query
123
134
self . headers = headers
124
135
}
125
136
}
126
- @ frozen package enum Output : Sendable , Hashable {
127
- package struct Ok : Sendable , Hashable {
137
+ internal enum Output : Sendable , Hashable {
138
+ internal struct Ok : Sendable , Hashable {
128
139
/// - Remark: Generated from `#/paths/greet/GET/responses/200/content`.
129
- @ frozen package enum Body : Sendable , Hashable {
140
+ internal enum Body : Sendable , Hashable {
130
141
/// - Remark: Generated from `#/paths/greet/GET/responses/200/content/application\/json`.
131
142
case json( Components . Schemas . Greeting )
132
143
/// The associated value of the enum case if `self` is `.json`.
133
144
///
134
145
/// - Throws: An error if `self` is not `.json`.
135
146
/// - SeeAlso: `.json`.
136
- package var json : Components . Schemas . Greeting {
147
+ internal var json : Components . Schemas . Greeting {
137
148
get throws {
138
149
switch self {
139
150
case let . json( body) :
@@ -143,12 +154,12 @@ package enum Operations {
143
154
}
144
155
}
145
156
/// Received HTTP response body
146
- package var body : Operations . getGreeting . Output . Ok . Body
157
+ internal var body : Operations . getGreeting . Output . Ok . Body
147
158
/// Creates a new `Ok`.
148
159
///
149
160
/// - Parameters:
150
161
/// - body: Received HTTP response body
151
- package init ( body: Operations . getGreeting . Output . Ok . Body ) {
162
+ internal init ( body: Operations . getGreeting . Output . Ok . Body ) {
152
163
self . body = body
153
164
}
154
165
}
@@ -162,7 +173,7 @@ package enum Operations {
162
173
///
163
174
/// - Throws: An error if `self` is not `.ok`.
164
175
/// - SeeAlso: `.ok`.
165
- package var ok : Operations . getGreeting . Output . Ok {
176
+ internal var ok : Operations . getGreeting . Output . Ok {
166
177
get throws {
167
178
switch self {
168
179
case let . ok( response) :
@@ -180,26 +191,26 @@ package enum Operations {
180
191
/// A response with a code that is not documented in the OpenAPI document.
181
192
case undocumented( statusCode: Swift . Int , OpenAPIRuntime . UndocumentedPayload )
182
193
}
183
- @ frozen package enum AcceptableContentType : AcceptableProtocol {
194
+ internal enum AcceptableContentType : AcceptableProtocol {
184
195
case json
185
196
case other( Swift . String )
186
- package init ? ( rawValue: Swift . String ) {
197
+ internal init ? ( rawValue: Swift . String ) {
187
198
switch rawValue. lowercased ( ) {
188
199
case " application/json " :
189
200
self = . json
190
201
default :
191
202
self = . other( rawValue)
192
203
}
193
204
}
194
- package var rawValue : Swift . String {
205
+ internal var rawValue : Swift . String {
195
206
switch self {
196
207
case let . other( string) :
197
208
return string
198
209
case . json:
199
210
return " application/json "
200
211
}
201
212
}
202
- package static var allCases : [ Self ] {
213
+ internal static var allCases : [ Self ] {
203
214
[
204
215
. json
205
216
]
0 commit comments