test.grpc.swift 64 KB

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