test.grpc.swift 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434
  1. //
  2. // DO NOT EDIT.
  3. //
  4. // Generated by the protocol buffer compiler.
  5. // Source: src/proto/grpc/testing/test.proto
  6. //
  7. //
  8. // Copyright 2018, gRPC Authors All rights reserved.
  9. //
  10. // Licensed under the Apache License, Version 2.0 (the "License");
  11. // you may not use this file except in compliance with the License.
  12. // You may obtain a copy of the License at
  13. //
  14. // http://www.apache.org/licenses/LICENSE-2.0
  15. //
  16. // Unless required by applicable law or agreed to in writing, software
  17. // distributed under the License is distributed on an "AS IS" BASIS,
  18. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. // See the License for the specific language governing permissions and
  20. // limitations under the License.
  21. //
  22. import GRPC
  23. import NIO
  24. import SwiftProtobuf
  25. /// A simple service to test the various types of RPCs and experiment with
  26. /// performance with various types of payload.
  27. ///
  28. /// Usage: instantiate `Grpc_Testing_TestServiceClient`, then call methods of this protocol to make API calls.
  29. public protocol Grpc_Testing_TestServiceClientProtocol: GRPCClient {
  30. var serviceName: String { get }
  31. var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? { get }
  32. func emptyCall(
  33. _ request: Grpc_Testing_Empty,
  34. callOptions: CallOptions?
  35. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
  36. func unaryCall(
  37. _ request: Grpc_Testing_SimpleRequest,
  38. callOptions: CallOptions?
  39. ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
  40. func cacheableUnaryCall(
  41. _ request: Grpc_Testing_SimpleRequest,
  42. callOptions: CallOptions?
  43. ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
  44. func streamingOutputCall(
  45. _ request: Grpc_Testing_StreamingOutputCallRequest,
  46. callOptions: CallOptions?,
  47. handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
  48. ) -> ServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
  49. func streamingInputCall(
  50. callOptions: CallOptions?
  51. ) -> ClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>
  52. func fullDuplexCall(
  53. callOptions: CallOptions?,
  54. handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
  55. ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
  56. func halfDuplexCall(
  57. callOptions: CallOptions?,
  58. handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
  59. ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
  60. func unimplementedCall(
  61. _ request: Grpc_Testing_Empty,
  62. callOptions: CallOptions?
  63. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
  64. }
  65. extension Grpc_Testing_TestServiceClientProtocol {
  66. public var serviceName: String {
  67. return "grpc.testing.TestService"
  68. }
  69. /// One empty request followed by one empty response.
  70. ///
  71. /// - Parameters:
  72. /// - request: Request to send to EmptyCall.
  73. /// - callOptions: Call options.
  74. /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  75. public func emptyCall(
  76. _ request: Grpc_Testing_Empty,
  77. callOptions: CallOptions? = nil
  78. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
  79. return self.makeUnaryCall(
  80. path: "/grpc.testing.TestService/EmptyCall",
  81. request: request,
  82. callOptions: callOptions ?? self.defaultCallOptions,
  83. interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? []
  84. )
  85. }
  86. /// One request followed by one response.
  87. ///
  88. /// - Parameters:
  89. /// - request: Request to send to UnaryCall.
  90. /// - callOptions: Call options.
  91. /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  92. public func unaryCall(
  93. _ request: Grpc_Testing_SimpleRequest,
  94. callOptions: CallOptions? = nil
  95. ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
  96. return self.makeUnaryCall(
  97. path: "/grpc.testing.TestService/UnaryCall",
  98. request: request,
  99. callOptions: callOptions ?? self.defaultCallOptions,
  100. interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? []
  101. )
  102. }
  103. /// One request followed by one response. Response has cache control
  104. /// headers set such that a caching HTTP proxy (such as GFE) can
  105. /// satisfy subsequent requests.
  106. ///
  107. /// - Parameters:
  108. /// - request: Request to send to CacheableUnaryCall.
  109. /// - callOptions: Call options.
  110. /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  111. public func cacheableUnaryCall(
  112. _ request: Grpc_Testing_SimpleRequest,
  113. callOptions: CallOptions? = nil
  114. ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
  115. return self.makeUnaryCall(
  116. path: "/grpc.testing.TestService/CacheableUnaryCall",
  117. request: request,
  118. callOptions: callOptions ?? self.defaultCallOptions,
  119. interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? []
  120. )
  121. }
  122. /// One request followed by a sequence of responses (streamed download).
  123. /// The server returns the payload with client desired type and sizes.
  124. ///
  125. /// - Parameters:
  126. /// - request: Request to send to StreamingOutputCall.
  127. /// - callOptions: Call options.
  128. /// - handler: A closure called when each response is received from the server.
  129. /// - Returns: A `ServerStreamingCall` with futures for the metadata and status.
  130. public func streamingOutputCall(
  131. _ request: Grpc_Testing_StreamingOutputCallRequest,
  132. callOptions: CallOptions? = nil,
  133. handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
  134. ) -> ServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
  135. return self.makeServerStreamingCall(
  136. path: "/grpc.testing.TestService/StreamingOutputCall",
  137. request: request,
  138. callOptions: callOptions ?? self.defaultCallOptions,
  139. interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? [],
  140. handler: handler
  141. )
  142. }
  143. /// A sequence of requests followed by one response (streamed upload).
  144. /// The server returns the aggregated size of client payload as the result.
  145. ///
  146. /// Callers should use the `send` method on the returned object to send messages
  147. /// to the server. The caller should send an `.end` after the final message has been sent.
  148. ///
  149. /// - Parameters:
  150. /// - callOptions: Call options.
  151. /// - Returns: A `ClientStreamingCall` with futures for the metadata, status and response.
  152. public func streamingInputCall(
  153. callOptions: CallOptions? = nil
  154. ) -> ClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse> {
  155. return self.makeClientStreamingCall(
  156. path: "/grpc.testing.TestService/StreamingInputCall",
  157. callOptions: callOptions ?? self.defaultCallOptions,
  158. interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
  159. )
  160. }
  161. /// A sequence of requests with each request served by the server immediately.
  162. /// As one request could lead to multiple responses, this interface
  163. /// demonstrates the idea of full duplexing.
  164. ///
  165. /// Callers should use the `send` method on the returned object to send messages
  166. /// to the server. The caller should send an `.end` after the final message has been sent.
  167. ///
  168. /// - Parameters:
  169. /// - callOptions: Call options.
  170. /// - handler: A closure called when each response is received from the server.
  171. /// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
  172. public func fullDuplexCall(
  173. callOptions: CallOptions? = nil,
  174. handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
  175. ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
  176. return self.makeBidirectionalStreamingCall(
  177. path: "/grpc.testing.TestService/FullDuplexCall",
  178. callOptions: callOptions ?? self.defaultCallOptions,
  179. interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? [],
  180. handler: handler
  181. )
  182. }
  183. /// A sequence of requests followed by a sequence of responses.
  184. /// The server buffers all the client requests and then serves them in order. A
  185. /// stream of responses are returned to the client when the server starts with
  186. /// first request.
  187. ///
  188. /// Callers should use the `send` method on the returned object to send messages
  189. /// to the server. The caller should send an `.end` after the final message has been sent.
  190. ///
  191. /// - Parameters:
  192. /// - callOptions: Call options.
  193. /// - handler: A closure called when each response is received from the server.
  194. /// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
  195. public func halfDuplexCall(
  196. callOptions: CallOptions? = nil,
  197. handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
  198. ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
  199. return self.makeBidirectionalStreamingCall(
  200. path: "/grpc.testing.TestService/HalfDuplexCall",
  201. callOptions: callOptions ?? self.defaultCallOptions,
  202. interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? [],
  203. handler: handler
  204. )
  205. }
  206. /// The test server will not implement this method. It will be used
  207. /// to test the behavior when clients call unimplemented methods.
  208. ///
  209. /// - Parameters:
  210. /// - request: Request to send to UnimplementedCall.
  211. /// - callOptions: Call options.
  212. /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  213. public func unimplementedCall(
  214. _ request: Grpc_Testing_Empty,
  215. callOptions: CallOptions? = nil
  216. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
  217. return self.makeUnaryCall(
  218. path: "/grpc.testing.TestService/UnimplementedCall",
  219. request: request,
  220. callOptions: callOptions ?? self.defaultCallOptions,
  221. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
  222. )
  223. }
  224. }
  225. public protocol Grpc_Testing_TestServiceClientInterceptorFactoryProtocol {
  226. /// - Returns: Interceptors to use when invoking 'emptyCall'.
  227. func makeEmptyCallInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
  228. /// - Returns: Interceptors to use when invoking 'unaryCall'.
  229. func makeUnaryCallInterceptors() -> [ClientInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
  230. /// - Returns: Interceptors to use when invoking 'cacheableUnaryCall'.
  231. func makeCacheableUnaryCallInterceptors() -> [ClientInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
  232. /// - Returns: Interceptors to use when invoking 'streamingOutputCall'.
  233. func makeStreamingOutputCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
  234. /// - Returns: Interceptors to use when invoking 'streamingInputCall'.
  235. func makeStreamingInputCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>]
  236. /// - Returns: Interceptors to use when invoking 'fullDuplexCall'.
  237. func makeFullDuplexCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
  238. /// - Returns: Interceptors to use when invoking 'halfDuplexCall'.
  239. func makeHalfDuplexCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
  240. /// - Returns: Interceptors to use when invoking 'unimplementedCall'.
  241. func makeUnimplementedCallInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
  242. }
  243. public final class Grpc_Testing_TestServiceClient: Grpc_Testing_TestServiceClientProtocol {
  244. public let channel: GRPCChannel
  245. public var defaultCallOptions: CallOptions
  246. public var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol?
  247. /// Creates a client for the grpc.testing.TestService service.
  248. ///
  249. /// - Parameters:
  250. /// - channel: `GRPCChannel` to the service host.
  251. /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
  252. /// - interceptors: A factory providing interceptors for each RPC.
  253. public init(
  254. channel: GRPCChannel,
  255. defaultCallOptions: CallOptions = CallOptions(),
  256. interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? = nil
  257. ) {
  258. self.channel = channel
  259. self.defaultCallOptions = defaultCallOptions
  260. self.interceptors = interceptors
  261. }
  262. }
  263. #if compiler(>=5.5) && canImport(_Concurrency)
  264. /// A simple service to test the various types of RPCs and experiment with
  265. /// performance with various types of payload.
  266. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  267. public protocol Grpc_Testing_TestServiceAsyncClientProtocol: GRPCClient {
  268. var serviceName: String { get }
  269. var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? { get }
  270. func makeEmptyCallCall(
  271. _ request: Grpc_Testing_Empty,
  272. callOptions: CallOptions?
  273. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
  274. func makeUnaryCallCall(
  275. _ request: Grpc_Testing_SimpleRequest,
  276. callOptions: CallOptions?
  277. ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
  278. func makeCacheableUnaryCallCall(
  279. _ request: Grpc_Testing_SimpleRequest,
  280. callOptions: CallOptions?
  281. ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
  282. func makeStreamingOutputCallCall(
  283. _ request: Grpc_Testing_StreamingOutputCallRequest,
  284. callOptions: CallOptions?
  285. ) -> GRPCAsyncServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
  286. func makeStreamingInputCallCall(
  287. callOptions: CallOptions?
  288. ) -> GRPCAsyncClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>
  289. func makeFullDuplexCallCall(
  290. callOptions: CallOptions?
  291. ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
  292. func makeHalfDuplexCallCall(
  293. callOptions: CallOptions?
  294. ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
  295. func makeUnimplementedCallCall(
  296. _ request: Grpc_Testing_Empty,
  297. callOptions: CallOptions?
  298. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
  299. }
  300. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  301. extension Grpc_Testing_TestServiceAsyncClientProtocol {
  302. public var serviceName: String {
  303. return "grpc.testing.TestService"
  304. }
  305. public var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? {
  306. return nil
  307. }
  308. public func makeEmptyCallCall(
  309. _ request: Grpc_Testing_Empty,
  310. callOptions: CallOptions? = nil
  311. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
  312. return self.makeAsyncUnaryCall(
  313. path: "/grpc.testing.TestService/EmptyCall",
  314. request: request,
  315. callOptions: callOptions ?? self.defaultCallOptions,
  316. interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? []
  317. )
  318. }
  319. public func makeUnaryCallCall(
  320. _ request: Grpc_Testing_SimpleRequest,
  321. callOptions: CallOptions? = nil
  322. ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
  323. return self.makeAsyncUnaryCall(
  324. path: "/grpc.testing.TestService/UnaryCall",
  325. request: request,
  326. callOptions: callOptions ?? self.defaultCallOptions,
  327. interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? []
  328. )
  329. }
  330. public func makeCacheableUnaryCallCall(
  331. _ request: Grpc_Testing_SimpleRequest,
  332. callOptions: CallOptions? = nil
  333. ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
  334. return self.makeAsyncUnaryCall(
  335. path: "/grpc.testing.TestService/CacheableUnaryCall",
  336. request: request,
  337. callOptions: callOptions ?? self.defaultCallOptions,
  338. interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? []
  339. )
  340. }
  341. public func makeStreamingOutputCallCall(
  342. _ request: Grpc_Testing_StreamingOutputCallRequest,
  343. callOptions: CallOptions? = nil
  344. ) -> GRPCAsyncServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
  345. return self.makeAsyncServerStreamingCall(
  346. path: "/grpc.testing.TestService/StreamingOutputCall",
  347. request: request,
  348. callOptions: callOptions ?? self.defaultCallOptions,
  349. interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? []
  350. )
  351. }
  352. public func makeStreamingInputCallCall(
  353. callOptions: CallOptions? = nil
  354. ) -> GRPCAsyncClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse> {
  355. return self.makeAsyncClientStreamingCall(
  356. path: "/grpc.testing.TestService/StreamingInputCall",
  357. callOptions: callOptions ?? self.defaultCallOptions,
  358. interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
  359. )
  360. }
  361. public func makeFullDuplexCallCall(
  362. callOptions: CallOptions? = nil
  363. ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
  364. return self.makeAsyncBidirectionalStreamingCall(
  365. path: "/grpc.testing.TestService/FullDuplexCall",
  366. callOptions: callOptions ?? self.defaultCallOptions,
  367. interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? []
  368. )
  369. }
  370. public func makeHalfDuplexCallCall(
  371. callOptions: CallOptions? = nil
  372. ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
  373. return self.makeAsyncBidirectionalStreamingCall(
  374. path: "/grpc.testing.TestService/HalfDuplexCall",
  375. callOptions: callOptions ?? self.defaultCallOptions,
  376. interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? []
  377. )
  378. }
  379. public func makeUnimplementedCallCall(
  380. _ request: Grpc_Testing_Empty,
  381. callOptions: CallOptions? = nil
  382. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
  383. return self.makeAsyncUnaryCall(
  384. path: "/grpc.testing.TestService/UnimplementedCall",
  385. request: request,
  386. callOptions: callOptions ?? self.defaultCallOptions,
  387. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
  388. )
  389. }
  390. }
  391. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  392. extension Grpc_Testing_TestServiceAsyncClientProtocol {
  393. public func emptyCall(
  394. _ request: Grpc_Testing_Empty,
  395. callOptions: CallOptions? = nil
  396. ) async throws -> Grpc_Testing_Empty {
  397. return try await self.performAsyncUnaryCall(
  398. path: "/grpc.testing.TestService/EmptyCall",
  399. request: request,
  400. callOptions: callOptions ?? self.defaultCallOptions,
  401. interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? []
  402. )
  403. }
  404. public func unaryCall(
  405. _ request: Grpc_Testing_SimpleRequest,
  406. callOptions: CallOptions? = nil
  407. ) async throws -> Grpc_Testing_SimpleResponse {
  408. return try await self.performAsyncUnaryCall(
  409. path: "/grpc.testing.TestService/UnaryCall",
  410. request: request,
  411. callOptions: callOptions ?? self.defaultCallOptions,
  412. interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? []
  413. )
  414. }
  415. public func cacheableUnaryCall(
  416. _ request: Grpc_Testing_SimpleRequest,
  417. callOptions: CallOptions? = nil
  418. ) async throws -> Grpc_Testing_SimpleResponse {
  419. return try await self.performAsyncUnaryCall(
  420. path: "/grpc.testing.TestService/CacheableUnaryCall",
  421. request: request,
  422. callOptions: callOptions ?? self.defaultCallOptions,
  423. interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? []
  424. )
  425. }
  426. public func streamingOutputCall(
  427. _ request: Grpc_Testing_StreamingOutputCallRequest,
  428. callOptions: CallOptions? = nil
  429. ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> {
  430. return self.performAsyncServerStreamingCall(
  431. path: "/grpc.testing.TestService/StreamingOutputCall",
  432. request: request,
  433. callOptions: callOptions ?? self.defaultCallOptions,
  434. interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? []
  435. )
  436. }
  437. public func streamingInputCall<RequestStream>(
  438. _ requests: RequestStream,
  439. callOptions: CallOptions? = nil
  440. ) async throws -> Grpc_Testing_StreamingInputCallResponse where RequestStream: Sequence, RequestStream.Element == Grpc_Testing_StreamingInputCallRequest {
  441. return try await self.performAsyncClientStreamingCall(
  442. path: "/grpc.testing.TestService/StreamingInputCall",
  443. requests: requests,
  444. callOptions: callOptions ?? self.defaultCallOptions,
  445. interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
  446. )
  447. }
  448. public func streamingInputCall<RequestStream>(
  449. _ requests: RequestStream,
  450. callOptions: CallOptions? = nil
  451. ) async throws -> Grpc_Testing_StreamingInputCallResponse where RequestStream: AsyncSequence, RequestStream.Element == Grpc_Testing_StreamingInputCallRequest {
  452. return try await self.performAsyncClientStreamingCall(
  453. path: "/grpc.testing.TestService/StreamingInputCall",
  454. requests: requests,
  455. callOptions: callOptions ?? self.defaultCallOptions,
  456. interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
  457. )
  458. }
  459. public func fullDuplexCall<RequestStream>(
  460. _ requests: RequestStream,
  461. callOptions: CallOptions? = nil
  462. ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: Sequence, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
  463. return self.performAsyncBidirectionalStreamingCall(
  464. path: "/grpc.testing.TestService/FullDuplexCall",
  465. requests: requests,
  466. callOptions: callOptions ?? self.defaultCallOptions,
  467. interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? []
  468. )
  469. }
  470. public func fullDuplexCall<RequestStream>(
  471. _ requests: RequestStream,
  472. callOptions: CallOptions? = nil
  473. ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: AsyncSequence, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
  474. return self.performAsyncBidirectionalStreamingCall(
  475. path: "/grpc.testing.TestService/FullDuplexCall",
  476. requests: requests,
  477. callOptions: callOptions ?? self.defaultCallOptions,
  478. interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? []
  479. )
  480. }
  481. public func halfDuplexCall<RequestStream>(
  482. _ requests: RequestStream,
  483. callOptions: CallOptions? = nil
  484. ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: Sequence, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
  485. return self.performAsyncBidirectionalStreamingCall(
  486. path: "/grpc.testing.TestService/HalfDuplexCall",
  487. requests: requests,
  488. callOptions: callOptions ?? self.defaultCallOptions,
  489. interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? []
  490. )
  491. }
  492. public func halfDuplexCall<RequestStream>(
  493. _ requests: RequestStream,
  494. callOptions: CallOptions? = nil
  495. ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: AsyncSequence, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
  496. return self.performAsyncBidirectionalStreamingCall(
  497. path: "/grpc.testing.TestService/HalfDuplexCall",
  498. requests: requests,
  499. callOptions: callOptions ?? self.defaultCallOptions,
  500. interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? []
  501. )
  502. }
  503. public func unimplementedCall(
  504. _ request: Grpc_Testing_Empty,
  505. callOptions: CallOptions? = nil
  506. ) async throws -> Grpc_Testing_Empty {
  507. return try await self.performAsyncUnaryCall(
  508. path: "/grpc.testing.TestService/UnimplementedCall",
  509. request: request,
  510. callOptions: callOptions ?? self.defaultCallOptions,
  511. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
  512. )
  513. }
  514. }
  515. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  516. public struct Grpc_Testing_TestServiceAsyncClient: Grpc_Testing_TestServiceAsyncClientProtocol {
  517. public var channel: GRPCChannel
  518. public var defaultCallOptions: CallOptions
  519. public var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol?
  520. public init(
  521. channel: GRPCChannel,
  522. defaultCallOptions: CallOptions = CallOptions(),
  523. interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? = nil
  524. ) {
  525. self.channel = channel
  526. self.defaultCallOptions = defaultCallOptions
  527. self.interceptors = interceptors
  528. }
  529. }
  530. #endif // compiler(>=5.5) && canImport(_Concurrency)
  531. /// A simple service NOT implemented at servers so clients can test for
  532. /// that case.
  533. ///
  534. /// Usage: instantiate `Grpc_Testing_UnimplementedServiceClient`, then call methods of this protocol to make API calls.
  535. public protocol Grpc_Testing_UnimplementedServiceClientProtocol: GRPCClient {
  536. var serviceName: String { get }
  537. var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? { get }
  538. func unimplementedCall(
  539. _ request: Grpc_Testing_Empty,
  540. callOptions: CallOptions?
  541. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
  542. }
  543. extension Grpc_Testing_UnimplementedServiceClientProtocol {
  544. public var serviceName: String {
  545. return "grpc.testing.UnimplementedService"
  546. }
  547. /// A call that no server should implement
  548. ///
  549. /// - Parameters:
  550. /// - request: Request to send to UnimplementedCall.
  551. /// - callOptions: Call options.
  552. /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  553. public func unimplementedCall(
  554. _ request: Grpc_Testing_Empty,
  555. callOptions: CallOptions? = nil
  556. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
  557. return self.makeUnaryCall(
  558. path: "/grpc.testing.UnimplementedService/UnimplementedCall",
  559. request: request,
  560. callOptions: callOptions ?? self.defaultCallOptions,
  561. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
  562. )
  563. }
  564. }
  565. public protocol Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol {
  566. /// - Returns: Interceptors to use when invoking 'unimplementedCall'.
  567. func makeUnimplementedCallInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
  568. }
  569. public final class Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_UnimplementedServiceClientProtocol {
  570. public let channel: GRPCChannel
  571. public var defaultCallOptions: CallOptions
  572. public var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol?
  573. /// Creates a client for the grpc.testing.UnimplementedService service.
  574. ///
  575. /// - Parameters:
  576. /// - channel: `GRPCChannel` to the service host.
  577. /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
  578. /// - interceptors: A factory providing interceptors for each RPC.
  579. public init(
  580. channel: GRPCChannel,
  581. defaultCallOptions: CallOptions = CallOptions(),
  582. interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? = nil
  583. ) {
  584. self.channel = channel
  585. self.defaultCallOptions = defaultCallOptions
  586. self.interceptors = interceptors
  587. }
  588. }
  589. #if compiler(>=5.5) && canImport(_Concurrency)
  590. /// A simple service NOT implemented at servers so clients can test for
  591. /// that case.
  592. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  593. public protocol Grpc_Testing_UnimplementedServiceAsyncClientProtocol: GRPCClient {
  594. var serviceName: String { get }
  595. var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? { get }
  596. func makeUnimplementedCallCall(
  597. _ request: Grpc_Testing_Empty,
  598. callOptions: CallOptions?
  599. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
  600. }
  601. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  602. extension Grpc_Testing_UnimplementedServiceAsyncClientProtocol {
  603. public var serviceName: String {
  604. return "grpc.testing.UnimplementedService"
  605. }
  606. public var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? {
  607. return nil
  608. }
  609. public func makeUnimplementedCallCall(
  610. _ request: Grpc_Testing_Empty,
  611. callOptions: CallOptions? = nil
  612. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
  613. return self.makeAsyncUnaryCall(
  614. path: "/grpc.testing.UnimplementedService/UnimplementedCall",
  615. request: request,
  616. callOptions: callOptions ?? self.defaultCallOptions,
  617. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
  618. )
  619. }
  620. }
  621. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  622. extension Grpc_Testing_UnimplementedServiceAsyncClientProtocol {
  623. public func unimplementedCall(
  624. _ request: Grpc_Testing_Empty,
  625. callOptions: CallOptions? = nil
  626. ) async throws -> Grpc_Testing_Empty {
  627. return try await self.performAsyncUnaryCall(
  628. path: "/grpc.testing.UnimplementedService/UnimplementedCall",
  629. request: request,
  630. callOptions: callOptions ?? self.defaultCallOptions,
  631. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
  632. )
  633. }
  634. }
  635. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  636. public struct Grpc_Testing_UnimplementedServiceAsyncClient: Grpc_Testing_UnimplementedServiceAsyncClientProtocol {
  637. public var channel: GRPCChannel
  638. public var defaultCallOptions: CallOptions
  639. public var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol?
  640. public init(
  641. channel: GRPCChannel,
  642. defaultCallOptions: CallOptions = CallOptions(),
  643. interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? = nil
  644. ) {
  645. self.channel = channel
  646. self.defaultCallOptions = defaultCallOptions
  647. self.interceptors = interceptors
  648. }
  649. }
  650. #endif // compiler(>=5.5) && canImport(_Concurrency)
  651. /// A service used to control reconnect server.
  652. ///
  653. /// Usage: instantiate `Grpc_Testing_ReconnectServiceClient`, then call methods of this protocol to make API calls.
  654. public protocol Grpc_Testing_ReconnectServiceClientProtocol: GRPCClient {
  655. var serviceName: String { get }
  656. var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? { get }
  657. func start(
  658. _ request: Grpc_Testing_ReconnectParams,
  659. callOptions: CallOptions?
  660. ) -> UnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>
  661. func stop(
  662. _ request: Grpc_Testing_Empty,
  663. callOptions: CallOptions?
  664. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>
  665. }
  666. extension Grpc_Testing_ReconnectServiceClientProtocol {
  667. public var serviceName: String {
  668. return "grpc.testing.ReconnectService"
  669. }
  670. /// Unary call to Start
  671. ///
  672. /// - Parameters:
  673. /// - request: Request to send to Start.
  674. /// - callOptions: Call options.
  675. /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  676. public func start(
  677. _ request: Grpc_Testing_ReconnectParams,
  678. callOptions: CallOptions? = nil
  679. ) -> UnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty> {
  680. return self.makeUnaryCall(
  681. path: "/grpc.testing.ReconnectService/Start",
  682. request: request,
  683. callOptions: callOptions ?? self.defaultCallOptions,
  684. interceptors: self.interceptors?.makeStartInterceptors() ?? []
  685. )
  686. }
  687. /// Unary call to Stop
  688. ///
  689. /// - Parameters:
  690. /// - request: Request to send to Stop.
  691. /// - callOptions: Call options.
  692. /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
  693. public func stop(
  694. _ request: Grpc_Testing_Empty,
  695. callOptions: CallOptions? = nil
  696. ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo> {
  697. return self.makeUnaryCall(
  698. path: "/grpc.testing.ReconnectService/Stop",
  699. request: request,
  700. callOptions: callOptions ?? self.defaultCallOptions,
  701. interceptors: self.interceptors?.makeStopInterceptors() ?? []
  702. )
  703. }
  704. }
  705. public protocol Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol {
  706. /// - Returns: Interceptors to use when invoking 'start'.
  707. func makeStartInterceptors() -> [ClientInterceptor<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>]
  708. /// - Returns: Interceptors to use when invoking 'stop'.
  709. func makeStopInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>]
  710. }
  711. public final class Grpc_Testing_ReconnectServiceClient: Grpc_Testing_ReconnectServiceClientProtocol {
  712. public let channel: GRPCChannel
  713. public var defaultCallOptions: CallOptions
  714. public var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol?
  715. /// Creates a client for the grpc.testing.ReconnectService service.
  716. ///
  717. /// - Parameters:
  718. /// - channel: `GRPCChannel` to the service host.
  719. /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
  720. /// - interceptors: A factory providing interceptors for each RPC.
  721. public init(
  722. channel: GRPCChannel,
  723. defaultCallOptions: CallOptions = CallOptions(),
  724. interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? = nil
  725. ) {
  726. self.channel = channel
  727. self.defaultCallOptions = defaultCallOptions
  728. self.interceptors = interceptors
  729. }
  730. }
  731. #if compiler(>=5.5) && canImport(_Concurrency)
  732. /// A service used to control reconnect server.
  733. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  734. public protocol Grpc_Testing_ReconnectServiceAsyncClientProtocol: GRPCClient {
  735. var serviceName: String { get }
  736. var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? { get }
  737. func makeStartCall(
  738. _ request: Grpc_Testing_ReconnectParams,
  739. callOptions: CallOptions?
  740. ) -> GRPCAsyncUnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>
  741. func makeStopCall(
  742. _ request: Grpc_Testing_Empty,
  743. callOptions: CallOptions?
  744. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>
  745. }
  746. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  747. extension Grpc_Testing_ReconnectServiceAsyncClientProtocol {
  748. public var serviceName: String {
  749. return "grpc.testing.ReconnectService"
  750. }
  751. public var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? {
  752. return nil
  753. }
  754. public func makeStartCall(
  755. _ request: Grpc_Testing_ReconnectParams,
  756. callOptions: CallOptions? = nil
  757. ) -> GRPCAsyncUnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty> {
  758. return self.makeAsyncUnaryCall(
  759. path: "/grpc.testing.ReconnectService/Start",
  760. request: request,
  761. callOptions: callOptions ?? self.defaultCallOptions,
  762. interceptors: self.interceptors?.makeStartInterceptors() ?? []
  763. )
  764. }
  765. public func makeStopCall(
  766. _ request: Grpc_Testing_Empty,
  767. callOptions: CallOptions? = nil
  768. ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo> {
  769. return self.makeAsyncUnaryCall(
  770. path: "/grpc.testing.ReconnectService/Stop",
  771. request: request,
  772. callOptions: callOptions ?? self.defaultCallOptions,
  773. interceptors: self.interceptors?.makeStopInterceptors() ?? []
  774. )
  775. }
  776. }
  777. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  778. extension Grpc_Testing_ReconnectServiceAsyncClientProtocol {
  779. public func start(
  780. _ request: Grpc_Testing_ReconnectParams,
  781. callOptions: CallOptions? = nil
  782. ) async throws -> Grpc_Testing_Empty {
  783. return try await self.performAsyncUnaryCall(
  784. path: "/grpc.testing.ReconnectService/Start",
  785. request: request,
  786. callOptions: callOptions ?? self.defaultCallOptions,
  787. interceptors: self.interceptors?.makeStartInterceptors() ?? []
  788. )
  789. }
  790. public func stop(
  791. _ request: Grpc_Testing_Empty,
  792. callOptions: CallOptions? = nil
  793. ) async throws -> Grpc_Testing_ReconnectInfo {
  794. return try await self.performAsyncUnaryCall(
  795. path: "/grpc.testing.ReconnectService/Stop",
  796. request: request,
  797. callOptions: callOptions ?? self.defaultCallOptions,
  798. interceptors: self.interceptors?.makeStopInterceptors() ?? []
  799. )
  800. }
  801. }
  802. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  803. public struct Grpc_Testing_ReconnectServiceAsyncClient: Grpc_Testing_ReconnectServiceAsyncClientProtocol {
  804. public var channel: GRPCChannel
  805. public var defaultCallOptions: CallOptions
  806. public var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol?
  807. public init(
  808. channel: GRPCChannel,
  809. defaultCallOptions: CallOptions = CallOptions(),
  810. interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? = nil
  811. ) {
  812. self.channel = channel
  813. self.defaultCallOptions = defaultCallOptions
  814. self.interceptors = interceptors
  815. }
  816. }
  817. #endif // compiler(>=5.5) && canImport(_Concurrency)
  818. /// A simple service to test the various types of RPCs and experiment with
  819. /// performance with various types of payload.
  820. ///
  821. /// To build a server, implement a class that conforms to this protocol.
  822. public protocol Grpc_Testing_TestServiceProvider: CallHandlerProvider {
  823. var interceptors: Grpc_Testing_TestServiceServerInterceptorFactoryProtocol? { get }
  824. /// One empty request followed by one empty response.
  825. func emptyCall(request: Grpc_Testing_Empty, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_Empty>
  826. /// One request followed by one response.
  827. func unaryCall(request: Grpc_Testing_SimpleRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_SimpleResponse>
  828. /// One request followed by one response. Response has cache control
  829. /// headers set such that a caching HTTP proxy (such as GFE) can
  830. /// satisfy subsequent requests.
  831. func cacheableUnaryCall(request: Grpc_Testing_SimpleRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_SimpleResponse>
  832. /// One request followed by a sequence of responses (streamed download).
  833. /// The server returns the payload with client desired type and sizes.
  834. func streamingOutputCall(request: Grpc_Testing_StreamingOutputCallRequest, context: StreamingResponseCallContext<Grpc_Testing_StreamingOutputCallResponse>) -> EventLoopFuture<GRPCStatus>
  835. /// A sequence of requests followed by one response (streamed upload).
  836. /// The server returns the aggregated size of client payload as the result.
  837. func streamingInputCall(context: UnaryResponseCallContext<Grpc_Testing_StreamingInputCallResponse>) -> EventLoopFuture<(StreamEvent<Grpc_Testing_StreamingInputCallRequest>) -> Void>
  838. /// A sequence of requests with each request served by the server immediately.
  839. /// As one request could lead to multiple responses, this interface
  840. /// demonstrates the idea of full duplexing.
  841. func fullDuplexCall(context: StreamingResponseCallContext<Grpc_Testing_StreamingOutputCallResponse>) -> EventLoopFuture<(StreamEvent<Grpc_Testing_StreamingOutputCallRequest>) -> Void>
  842. /// A sequence of requests followed by a sequence of responses.
  843. /// The server buffers all the client requests and then serves them in order. A
  844. /// stream of responses are returned to the client when the server starts with
  845. /// first request.
  846. func halfDuplexCall(context: StreamingResponseCallContext<Grpc_Testing_StreamingOutputCallResponse>) -> EventLoopFuture<(StreamEvent<Grpc_Testing_StreamingOutputCallRequest>) -> Void>
  847. }
  848. extension Grpc_Testing_TestServiceProvider {
  849. public var serviceName: Substring { return "grpc.testing.TestService" }
  850. /// Determines, calls and returns the appropriate request handler, depending on the request's method.
  851. /// Returns nil for methods not handled by this service.
  852. public func handle(
  853. method name: Substring,
  854. context: CallHandlerContext
  855. ) -> GRPCServerHandlerProtocol? {
  856. switch name {
  857. case "EmptyCall":
  858. return UnaryServerHandler(
  859. context: context,
  860. requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  861. responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  862. interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? [],
  863. userFunction: self.emptyCall(request:context:)
  864. )
  865. case "UnaryCall":
  866. return UnaryServerHandler(
  867. context: context,
  868. requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
  869. responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
  870. interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? [],
  871. userFunction: self.unaryCall(request:context:)
  872. )
  873. case "CacheableUnaryCall":
  874. return UnaryServerHandler(
  875. context: context,
  876. requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
  877. responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
  878. interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? [],
  879. userFunction: self.cacheableUnaryCall(request:context:)
  880. )
  881. case "StreamingOutputCall":
  882. return ServerStreamingServerHandler(
  883. context: context,
  884. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  885. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  886. interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? [],
  887. userFunction: self.streamingOutputCall(request:context:)
  888. )
  889. case "StreamingInputCall":
  890. return ClientStreamingServerHandler(
  891. context: context,
  892. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingInputCallRequest>(),
  893. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingInputCallResponse>(),
  894. interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? [],
  895. observerFactory: self.streamingInputCall(context:)
  896. )
  897. case "FullDuplexCall":
  898. return BidirectionalStreamingServerHandler(
  899. context: context,
  900. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  901. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  902. interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? [],
  903. observerFactory: self.fullDuplexCall(context:)
  904. )
  905. case "HalfDuplexCall":
  906. return BidirectionalStreamingServerHandler(
  907. context: context,
  908. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  909. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  910. interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? [],
  911. observerFactory: self.halfDuplexCall(context:)
  912. )
  913. default:
  914. return nil
  915. }
  916. }
  917. }
  918. public protocol Grpc_Testing_TestServiceServerInterceptorFactoryProtocol {
  919. /// - Returns: Interceptors to use when handling 'emptyCall'.
  920. /// Defaults to calling `self.makeInterceptors()`.
  921. func makeEmptyCallInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
  922. /// - Returns: Interceptors to use when handling 'unaryCall'.
  923. /// Defaults to calling `self.makeInterceptors()`.
  924. func makeUnaryCallInterceptors() -> [ServerInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
  925. /// - Returns: Interceptors to use when handling 'cacheableUnaryCall'.
  926. /// Defaults to calling `self.makeInterceptors()`.
  927. func makeCacheableUnaryCallInterceptors() -> [ServerInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
  928. /// - Returns: Interceptors to use when handling 'streamingOutputCall'.
  929. /// Defaults to calling `self.makeInterceptors()`.
  930. func makeStreamingOutputCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
  931. /// - Returns: Interceptors to use when handling 'streamingInputCall'.
  932. /// Defaults to calling `self.makeInterceptors()`.
  933. func makeStreamingInputCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>]
  934. /// - Returns: Interceptors to use when handling 'fullDuplexCall'.
  935. /// Defaults to calling `self.makeInterceptors()`.
  936. func makeFullDuplexCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
  937. /// - Returns: Interceptors to use when handling 'halfDuplexCall'.
  938. /// Defaults to calling `self.makeInterceptors()`.
  939. func makeHalfDuplexCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
  940. /// - Returns: Interceptors to use when handling 'unimplementedCall'.
  941. /// Defaults to calling `self.makeInterceptors()`.
  942. func makeUnimplementedCallInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
  943. }
  944. #if compiler(>=5.5) && canImport(_Concurrency)
  945. /// A simple service to test the various types of RPCs and experiment with
  946. /// performance with various types of payload.
  947. ///
  948. /// To implement a server, implement an object which conforms to this protocol.
  949. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  950. public protocol Grpc_Testing_TestServiceAsyncProvider: CallHandlerProvider {
  951. var interceptors: Grpc_Testing_TestServiceServerInterceptorFactoryProtocol? { get }
  952. /// One empty request followed by one empty response.
  953. @Sendable func emptyCall(
  954. request: Grpc_Testing_Empty,
  955. context: GRPCAsyncServerCallContext
  956. ) async throws -> Grpc_Testing_Empty
  957. /// One request followed by one response.
  958. @Sendable func unaryCall(
  959. request: Grpc_Testing_SimpleRequest,
  960. context: GRPCAsyncServerCallContext
  961. ) async throws -> Grpc_Testing_SimpleResponse
  962. /// One request followed by one response. Response has cache control
  963. /// headers set such that a caching HTTP proxy (such as GFE) can
  964. /// satisfy subsequent requests.
  965. @Sendable func cacheableUnaryCall(
  966. request: Grpc_Testing_SimpleRequest,
  967. context: GRPCAsyncServerCallContext
  968. ) async throws -> Grpc_Testing_SimpleResponse
  969. /// One request followed by a sequence of responses (streamed download).
  970. /// The server returns the payload with client desired type and sizes.
  971. @Sendable func streamingOutputCall(
  972. request: Grpc_Testing_StreamingOutputCallRequest,
  973. responseStream: GRPCAsyncResponseStreamWriter<Grpc_Testing_StreamingOutputCallResponse>,
  974. context: GRPCAsyncServerCallContext
  975. ) async throws
  976. /// A sequence of requests followed by one response (streamed upload).
  977. /// The server returns the aggregated size of client payload as the result.
  978. @Sendable func streamingInputCall(
  979. requestStream: GRPCAsyncRequestStream<Grpc_Testing_StreamingInputCallRequest>,
  980. context: GRPCAsyncServerCallContext
  981. ) async throws -> Grpc_Testing_StreamingInputCallResponse
  982. /// A sequence of requests with each request served by the server immediately.
  983. /// As one request could lead to multiple responses, this interface
  984. /// demonstrates the idea of full duplexing.
  985. @Sendable func fullDuplexCall(
  986. requestStream: GRPCAsyncRequestStream<Grpc_Testing_StreamingOutputCallRequest>,
  987. responseStream: GRPCAsyncResponseStreamWriter<Grpc_Testing_StreamingOutputCallResponse>,
  988. context: GRPCAsyncServerCallContext
  989. ) async throws
  990. /// A sequence of requests followed by a sequence of responses.
  991. /// The server buffers all the client requests and then serves them in order. A
  992. /// stream of responses are returned to the client when the server starts with
  993. /// first request.
  994. @Sendable func halfDuplexCall(
  995. requestStream: GRPCAsyncRequestStream<Grpc_Testing_StreamingOutputCallRequest>,
  996. responseStream: GRPCAsyncResponseStreamWriter<Grpc_Testing_StreamingOutputCallResponse>,
  997. context: GRPCAsyncServerCallContext
  998. ) async throws
  999. }
  1000. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  1001. extension Grpc_Testing_TestServiceAsyncProvider {
  1002. public var serviceName: Substring {
  1003. return "grpc.testing.TestService"
  1004. }
  1005. public var interceptors: Grpc_Testing_TestServiceServerInterceptorFactoryProtocol? {
  1006. return nil
  1007. }
  1008. public func handle(
  1009. method name: Substring,
  1010. context: CallHandlerContext
  1011. ) -> GRPCServerHandlerProtocol? {
  1012. switch name {
  1013. case "EmptyCall":
  1014. return GRPCAsyncServerHandler(
  1015. context: context,
  1016. requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  1017. responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  1018. interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? [],
  1019. wrapping: self.emptyCall(request:context:)
  1020. )
  1021. case "UnaryCall":
  1022. return GRPCAsyncServerHandler(
  1023. context: context,
  1024. requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
  1025. responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
  1026. interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? [],
  1027. wrapping: self.unaryCall(request:context:)
  1028. )
  1029. case "CacheableUnaryCall":
  1030. return GRPCAsyncServerHandler(
  1031. context: context,
  1032. requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
  1033. responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
  1034. interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? [],
  1035. wrapping: self.cacheableUnaryCall(request:context:)
  1036. )
  1037. case "StreamingOutputCall":
  1038. return GRPCAsyncServerHandler(
  1039. context: context,
  1040. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  1041. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  1042. interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? [],
  1043. wrapping: self.streamingOutputCall(request:responseStream:context:)
  1044. )
  1045. case "StreamingInputCall":
  1046. return GRPCAsyncServerHandler(
  1047. context: context,
  1048. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingInputCallRequest>(),
  1049. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingInputCallResponse>(),
  1050. interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? [],
  1051. wrapping: self.streamingInputCall(requestStream:context:)
  1052. )
  1053. case "FullDuplexCall":
  1054. return GRPCAsyncServerHandler(
  1055. context: context,
  1056. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  1057. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  1058. interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? [],
  1059. wrapping: self.fullDuplexCall(requestStream:responseStream:context:)
  1060. )
  1061. case "HalfDuplexCall":
  1062. return GRPCAsyncServerHandler(
  1063. context: context,
  1064. requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  1065. responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  1066. interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? [],
  1067. wrapping: self.halfDuplexCall(requestStream:responseStream:context:)
  1068. )
  1069. default:
  1070. return nil
  1071. }
  1072. }
  1073. }
  1074. #endif // compiler(>=5.5) && canImport(_Concurrency)
  1075. /// A simple service NOT implemented at servers so clients can test for
  1076. /// that case.
  1077. ///
  1078. /// To build a server, implement a class that conforms to this protocol.
  1079. public protocol Grpc_Testing_UnimplementedServiceProvider: CallHandlerProvider {
  1080. var interceptors: Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol? { get }
  1081. /// A call that no server should implement
  1082. func unimplementedCall(request: Grpc_Testing_Empty, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_Empty>
  1083. }
  1084. extension Grpc_Testing_UnimplementedServiceProvider {
  1085. public var serviceName: Substring { return "grpc.testing.UnimplementedService" }
  1086. /// Determines, calls and returns the appropriate request handler, depending on the request's method.
  1087. /// Returns nil for methods not handled by this service.
  1088. public func handle(
  1089. method name: Substring,
  1090. context: CallHandlerContext
  1091. ) -> GRPCServerHandlerProtocol? {
  1092. switch name {
  1093. case "UnimplementedCall":
  1094. return UnaryServerHandler(
  1095. context: context,
  1096. requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  1097. responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  1098. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? [],
  1099. userFunction: self.unimplementedCall(request:context:)
  1100. )
  1101. default:
  1102. return nil
  1103. }
  1104. }
  1105. }
  1106. public protocol Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol {
  1107. /// - Returns: Interceptors to use when handling 'unimplementedCall'.
  1108. /// Defaults to calling `self.makeInterceptors()`.
  1109. func makeUnimplementedCallInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
  1110. }
  1111. #if compiler(>=5.5) && canImport(_Concurrency)
  1112. /// A simple service NOT implemented at servers so clients can test for
  1113. /// that case.
  1114. ///
  1115. /// To implement a server, implement an object which conforms to this protocol.
  1116. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  1117. public protocol Grpc_Testing_UnimplementedServiceAsyncProvider: CallHandlerProvider {
  1118. var interceptors: Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol? { get }
  1119. /// A call that no server should implement
  1120. @Sendable func unimplementedCall(
  1121. request: Grpc_Testing_Empty,
  1122. context: GRPCAsyncServerCallContext
  1123. ) async throws -> Grpc_Testing_Empty
  1124. }
  1125. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  1126. extension Grpc_Testing_UnimplementedServiceAsyncProvider {
  1127. public var serviceName: Substring {
  1128. return "grpc.testing.UnimplementedService"
  1129. }
  1130. public var interceptors: Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol? {
  1131. return nil
  1132. }
  1133. public func handle(
  1134. method name: Substring,
  1135. context: CallHandlerContext
  1136. ) -> GRPCServerHandlerProtocol? {
  1137. switch name {
  1138. case "UnimplementedCall":
  1139. return GRPCAsyncServerHandler(
  1140. context: context,
  1141. requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  1142. responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  1143. interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? [],
  1144. wrapping: self.unimplementedCall(request:context:)
  1145. )
  1146. default:
  1147. return nil
  1148. }
  1149. }
  1150. }
  1151. #endif // compiler(>=5.5) && canImport(_Concurrency)
  1152. /// A service used to control reconnect server.
  1153. ///
  1154. /// To build a server, implement a class that conforms to this protocol.
  1155. public protocol Grpc_Testing_ReconnectServiceProvider: CallHandlerProvider {
  1156. var interceptors: Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol? { get }
  1157. func start(request: Grpc_Testing_ReconnectParams, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_Empty>
  1158. func stop(request: Grpc_Testing_Empty, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_ReconnectInfo>
  1159. }
  1160. extension Grpc_Testing_ReconnectServiceProvider {
  1161. public var serviceName: Substring { return "grpc.testing.ReconnectService" }
  1162. /// Determines, calls and returns the appropriate request handler, depending on the request's method.
  1163. /// Returns nil for methods not handled by this service.
  1164. public func handle(
  1165. method name: Substring,
  1166. context: CallHandlerContext
  1167. ) -> GRPCServerHandlerProtocol? {
  1168. switch name {
  1169. case "Start":
  1170. return UnaryServerHandler(
  1171. context: context,
  1172. requestDeserializer: ProtobufDeserializer<Grpc_Testing_ReconnectParams>(),
  1173. responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  1174. interceptors: self.interceptors?.makeStartInterceptors() ?? [],
  1175. userFunction: self.start(request:context:)
  1176. )
  1177. case "Stop":
  1178. return UnaryServerHandler(
  1179. context: context,
  1180. requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  1181. responseSerializer: ProtobufSerializer<Grpc_Testing_ReconnectInfo>(),
  1182. interceptors: self.interceptors?.makeStopInterceptors() ?? [],
  1183. userFunction: self.stop(request:context:)
  1184. )
  1185. default:
  1186. return nil
  1187. }
  1188. }
  1189. }
  1190. public protocol Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol {
  1191. /// - Returns: Interceptors to use when handling 'start'.
  1192. /// Defaults to calling `self.makeInterceptors()`.
  1193. func makeStartInterceptors() -> [ServerInterceptor<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>]
  1194. /// - Returns: Interceptors to use when handling 'stop'.
  1195. /// Defaults to calling `self.makeInterceptors()`.
  1196. func makeStopInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>]
  1197. }
  1198. #if compiler(>=5.5) && canImport(_Concurrency)
  1199. /// A service used to control reconnect server.
  1200. ///
  1201. /// To implement a server, implement an object which conforms to this protocol.
  1202. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  1203. public protocol Grpc_Testing_ReconnectServiceAsyncProvider: CallHandlerProvider {
  1204. var interceptors: Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol? { get }
  1205. @Sendable func start(
  1206. request: Grpc_Testing_ReconnectParams,
  1207. context: GRPCAsyncServerCallContext
  1208. ) async throws -> Grpc_Testing_Empty
  1209. @Sendable func stop(
  1210. request: Grpc_Testing_Empty,
  1211. context: GRPCAsyncServerCallContext
  1212. ) async throws -> Grpc_Testing_ReconnectInfo
  1213. }
  1214. @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
  1215. extension Grpc_Testing_ReconnectServiceAsyncProvider {
  1216. public var serviceName: Substring {
  1217. return "grpc.testing.ReconnectService"
  1218. }
  1219. public var interceptors: Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol? {
  1220. return nil
  1221. }
  1222. public func handle(
  1223. method name: Substring,
  1224. context: CallHandlerContext
  1225. ) -> GRPCServerHandlerProtocol? {
  1226. switch name {
  1227. case "Start":
  1228. return GRPCAsyncServerHandler(
  1229. context: context,
  1230. requestDeserializer: ProtobufDeserializer<Grpc_Testing_ReconnectParams>(),
  1231. responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  1232. interceptors: self.interceptors?.makeStartInterceptors() ?? [],
  1233. wrapping: self.start(request:context:)
  1234. )
  1235. case "Stop":
  1236. return GRPCAsyncServerHandler(
  1237. context: context,
  1238. requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  1239. responseSerializer: ProtobufSerializer<Grpc_Testing_ReconnectInfo>(),
  1240. interceptors: self.interceptors?.makeStopInterceptors() ?? [],
  1241. wrapping: self.stop(request:context:)
  1242. )
  1243. default:
  1244. return nil
  1245. }
  1246. }
  1247. }
  1248. #endif // compiler(>=5.5) && canImport(_Concurrency)