@@ -10,7 +10,7 @@ import struct Foundation.Data
1010import struct Foundation. Date
1111#endif
1212/// A type that performs HTTP operations defined by the OpenAPI document.
13- package protocol APIProtocol : Sendable {
13+ internal protocol APIProtocol : Sendable {
1414 /// - Remark: HTTP `GET /greet`.
1515 /// - Remark: Generated from `#/paths//greet/get(getGreeting)`.
1616 func getGreeting( _ input: Operations . getGreeting . Input ) async throws -> Operations . getGreeting . Output
@@ -20,7 +20,7 @@ package protocol APIProtocol: Sendable {
2020extension APIProtocol {
2121 /// - Remark: HTTP `GET /greet`.
2222 /// - Remark: Generated from `#/paths//greet/get(getGreeting)`.
23- package func getGreeting(
23+ internal func getGreeting(
2424 query: Operations . getGreeting . Input . Query = . init( ) ,
2525 headers: Operations . getGreeting . Input . Headers = . init( )
2626 ) async throws -> Operations . getGreeting . Output {
@@ -32,9 +32,20 @@ extension APIProtocol {
3232}
3333
3434/// Server URLs defined in the OpenAPI document.
35- package enum Servers {
35+ internal enum Servers {
3636 /// 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 {
3849 try Foundation . URL (
3950 validatingOpenAPIServerURL: " https://example.com/api " ,
4051 variables: [ ]
@@ -43,97 +54,97 @@ package enum Servers {
4354}
4455
4556/// Types generated from the components section of the OpenAPI document.
46- package enum Components {
57+ internal enum Components {
4758 /// Types generated from the `#/components/schemas` section of the OpenAPI document.
48- package enum Schemas {
59+ internal enum Schemas {
4960 /// A value with the greeting contents.
5061 ///
5162 /// - Remark: Generated from `#/components/schemas/Greeting`.
52- package struct Greeting : Codable , Hashable , Sendable {
63+ internal struct Greeting : Codable , Hashable , Sendable {
5364 /// The string representation of the greeting.
5465 ///
5566 /// - Remark: Generated from `#/components/schemas/Greeting/message`.
56- package var message : Swift . String
67+ internal var message : Swift . String
5768 /// Creates a new `Greeting`.
5869 ///
5970 /// - Parameters:
6071 /// - message: The string representation of the greeting.
61- package init ( message: Swift . String ) {
72+ internal init ( message: Swift . String ) {
6273 self . message = message
6374 }
64- package enum CodingKeys : String , CodingKey {
75+ internal enum CodingKeys : String , CodingKey {
6576 case message
6677 }
6778 }
6879 }
6980 /// Types generated from the `#/components/parameters` section of the OpenAPI document.
70- package enum Parameters { }
81+ internal enum Parameters { }
7182 /// Types generated from the `#/components/requestBodies` section of the OpenAPI document.
72- package enum RequestBodies { }
83+ internal enum RequestBodies { }
7384 /// Types generated from the `#/components/responses` section of the OpenAPI document.
74- package enum Responses { }
85+ internal enum Responses { }
7586 /// Types generated from the `#/components/headers` section of the OpenAPI document.
76- package enum Headers { }
87+ internal enum Headers { }
7788}
7889
7990/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document.
80- package enum Operations {
91+ internal enum Operations {
8192 /// - Remark: HTTP `GET /greet`.
8293 /// - 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 {
8697 /// - Remark: Generated from `#/paths/greet/GET/query`.
87- package struct Query : Sendable , Hashable {
98+ internal struct Query : Sendable , Hashable {
8899 /// The name used in the returned greeting.
89100 ///
90101 /// - Remark: Generated from `#/paths/greet/GET/query/name`.
91- package var name : Swift . String ?
102+ internal var name : Swift . String ?
92103 /// Creates a new `Query`.
93104 ///
94105 /// - Parameters:
95106 /// - name: The name used in the returned greeting.
96- package init ( name: Swift . String ? = nil ) {
107+ internal init ( name: Swift . String ? = nil ) {
97108 self . name = name
98109 }
99110 }
100- package var query : Operations . getGreeting . Input . Query
111+ internal var query : Operations . getGreeting . Input . Query
101112 /// - 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 > ]
104115 /// Creates a new `Headers`.
105116 ///
106117 /// - Parameters:
107118 /// - accept:
108- package init ( accept: [ OpenAPIRuntime . AcceptHeaderContentType < Operations . getGreeting . AcceptableContentType > ] = . defaultValues( ) ) {
119+ internal init ( accept: [ OpenAPIRuntime . AcceptHeaderContentType < Operations . getGreeting . AcceptableContentType > ] = . defaultValues( ) ) {
109120 self . accept = accept
110121 }
111122 }
112- package var headers : Operations . getGreeting . Input . Headers
123+ internal var headers : Operations . getGreeting . Input . Headers
113124 /// Creates a new `Input`.
114125 ///
115126 /// - Parameters:
116127 /// - query:
117128 /// - headers:
118- package init (
129+ internal init (
119130 query: Operations . getGreeting . Input . Query = . init( ) ,
120131 headers: Operations . getGreeting . Input . Headers = . init( )
121132 ) {
122133 self . query = query
123134 self . headers = headers
124135 }
125136 }
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 {
128139 /// - Remark: Generated from `#/paths/greet/GET/responses/200/content`.
129- @ frozen package enum Body : Sendable , Hashable {
140+ internal enum Body : Sendable , Hashable {
130141 /// - Remark: Generated from `#/paths/greet/GET/responses/200/content/application\/json`.
131142 case json( Components . Schemas . Greeting )
132143 /// The associated value of the enum case if `self` is `.json`.
133144 ///
134145 /// - Throws: An error if `self` is not `.json`.
135146 /// - SeeAlso: `.json`.
136- package var json : Components . Schemas . Greeting {
147+ internal var json : Components . Schemas . Greeting {
137148 get throws {
138149 switch self {
139150 case let . json( body) :
@@ -143,12 +154,12 @@ package enum Operations {
143154 }
144155 }
145156 /// Received HTTP response body
146- package var body : Operations . getGreeting . Output . Ok . Body
157+ internal var body : Operations . getGreeting . Output . Ok . Body
147158 /// Creates a new `Ok`.
148159 ///
149160 /// - Parameters:
150161 /// - body: Received HTTP response body
151- package init ( body: Operations . getGreeting . Output . Ok . Body ) {
162+ internal init ( body: Operations . getGreeting . Output . Ok . Body ) {
152163 self . body = body
153164 }
154165 }
@@ -162,7 +173,7 @@ package enum Operations {
162173 ///
163174 /// - Throws: An error if `self` is not `.ok`.
164175 /// - SeeAlso: `.ok`.
165- package var ok : Operations . getGreeting . Output . Ok {
176+ internal var ok : Operations . getGreeting . Output . Ok {
166177 get throws {
167178 switch self {
168179 case let . ok( response) :
@@ -180,26 +191,26 @@ package enum Operations {
180191 /// A response with a code that is not documented in the OpenAPI document.
181192 case undocumented( statusCode: Swift . Int , OpenAPIRuntime . UndocumentedPayload )
182193 }
183- @ frozen package enum AcceptableContentType : AcceptableProtocol {
194+ internal enum AcceptableContentType : AcceptableProtocol {
184195 case json
185196 case other( Swift . String )
186- package init ? ( rawValue: Swift . String ) {
197+ internal init ? ( rawValue: Swift . String ) {
187198 switch rawValue. lowercased ( ) {
188199 case " application/json " :
189200 self = . json
190201 default :
191202 self = . other( rawValue)
192203 }
193204 }
194- package var rawValue : Swift . String {
205+ internal var rawValue : Swift . String {
195206 switch self {
196207 case let . other( string) :
197208 return string
198209 case . json:
199210 return " application/json "
200211 }
201212 }
202- package static var allCases : [ Self ] {
213+ internal static var allCases : [ Self ] {
203214 [
204215 . json
205216 ]
0 commit comments