test.grpc.swift 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  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. import GRPCCore
  25. import GRPCProtobuf
  26. public enum Grpc_Testing_ReconnectService {
  27. public static let descriptor = 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 = 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 = MethodDescriptor(
  41. service: Grpc_Testing_ReconnectService.descriptor.fullyQualifiedService,
  42. method: "Stop"
  43. )
  44. }
  45. public static let descriptors: [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 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = MethodDescriptor(
  128. service: Grpc_Testing_TestService.descriptor.fullyQualifiedService,
  129. method: "UnimplementedCall"
  130. )
  131. }
  132. public static let descriptors: [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 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 = 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 = MethodDescriptor(
  165. service: Grpc_Testing_UnimplementedService.descriptor.fullyQualifiedService,
  166. method: "UnimplementedCall"
  167. )
  168. }
  169. public static let descriptors: [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 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(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty>
  194. /// One request followed by one response.
  195. func unaryCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
  196. /// One request followed by one response. Response has cache control
  197. /// headers set such that a caching HTTP proxy (such as GFE) can
  198. /// satisfy subsequent requests.
  199. func cacheableUnaryCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse>
  200. /// One request followed by a sequence of responses (streamed download).
  201. /// The server returns the payload with client desired type and sizes.
  202. func streamingOutputCall(request: ServerRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>
  203. /// A sequence of requests followed by one response (streamed upload).
  204. /// The server returns the aggregated size of client payload as the result.
  205. func streamingInputCall(request: ServerRequest.Stream<Grpc_Testing_StreamingInputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingInputCallResponse>
  206. /// A sequence of requests with each request served by the server immediately.
  207. /// As one request could lead to multiple responses, this interface
  208. /// demonstrates the idea of full duplexing.
  209. func fullDuplexCall(request: ServerRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>
  210. /// A sequence of requests followed by a sequence of responses.
  211. /// The server buffers all the client requests and then serves them in order. A
  212. /// stream of responses are returned to the client when the server starts with
  213. /// first request.
  214. func halfDuplexCall(request: ServerRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>
  215. /// The test server will not implement this method. It will be used
  216. /// to test the behavior when clients call unimplemented methods.
  217. func unimplementedCall(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty>
  218. }
  219. /// Conformance to `GRPCCore.RegistrableRPCService`.
  220. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  221. extension Grpc_Testing_TestService.StreamingServiceProtocol {
  222. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  223. public func registerMethods(with router: inout GRPCCore.RPCRouter) {
  224. router.registerHandler(
  225. forMethod: Grpc_Testing_TestService.Method.EmptyCall.descriptor,
  226. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  227. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  228. handler: { request in
  229. try await self.emptyCall(request: request)
  230. }
  231. )
  232. router.registerHandler(
  233. forMethod: Grpc_Testing_TestService.Method.UnaryCall.descriptor,
  234. deserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
  235. serializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
  236. handler: { request in
  237. try await self.unaryCall(request: request)
  238. }
  239. )
  240. router.registerHandler(
  241. forMethod: Grpc_Testing_TestService.Method.CacheableUnaryCall.descriptor,
  242. deserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
  243. serializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
  244. handler: { request in
  245. try await self.cacheableUnaryCall(request: request)
  246. }
  247. )
  248. router.registerHandler(
  249. forMethod: Grpc_Testing_TestService.Method.StreamingOutputCall.descriptor,
  250. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  251. serializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  252. handler: { request in
  253. try await self.streamingOutputCall(request: request)
  254. }
  255. )
  256. router.registerHandler(
  257. forMethod: Grpc_Testing_TestService.Method.StreamingInputCall.descriptor,
  258. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingInputCallRequest>(),
  259. serializer: ProtobufSerializer<Grpc_Testing_StreamingInputCallResponse>(),
  260. handler: { request in
  261. try await self.streamingInputCall(request: request)
  262. }
  263. )
  264. router.registerHandler(
  265. forMethod: Grpc_Testing_TestService.Method.FullDuplexCall.descriptor,
  266. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  267. serializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  268. handler: { request in
  269. try await self.fullDuplexCall(request: request)
  270. }
  271. )
  272. router.registerHandler(
  273. forMethod: Grpc_Testing_TestService.Method.HalfDuplexCall.descriptor,
  274. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
  275. serializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
  276. handler: { request in
  277. try await self.halfDuplexCall(request: request)
  278. }
  279. )
  280. router.registerHandler(
  281. forMethod: Grpc_Testing_TestService.Method.UnimplementedCall.descriptor,
  282. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  283. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  284. handler: { request in
  285. try await self.unimplementedCall(request: request)
  286. }
  287. )
  288. }
  289. }
  290. /// A simple service to test the various types of RPCs and experiment with
  291. /// performance with various types of payload.
  292. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  293. public protocol Grpc_Testing_TestServiceServiceProtocol: Grpc_Testing_TestService.StreamingServiceProtocol {
  294. /// One empty request followed by one empty response.
  295. func emptyCall(request: ServerRequest.Single<Grpc_Testing_Empty>) async throws -> ServerResponse.Single<Grpc_Testing_Empty>
  296. /// One request followed by one response.
  297. func unaryCall(request: ServerRequest.Single<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Single<Grpc_Testing_SimpleResponse>
  298. /// One request followed by one response. Response has cache control
  299. /// headers set such that a caching HTTP proxy (such as GFE) can
  300. /// satisfy subsequent requests.
  301. func cacheableUnaryCall(request: ServerRequest.Single<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Single<Grpc_Testing_SimpleResponse>
  302. /// One request followed by a sequence of responses (streamed download).
  303. /// The server returns the payload with client desired type and sizes.
  304. func streamingOutputCall(request: ServerRequest.Single<Grpc_Testing_StreamingOutputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>
  305. /// A sequence of requests followed by one response (streamed upload).
  306. /// The server returns the aggregated size of client payload as the result.
  307. func streamingInputCall(request: ServerRequest.Stream<Grpc_Testing_StreamingInputCallRequest>) async throws -> ServerResponse.Single<Grpc_Testing_StreamingInputCallResponse>
  308. /// A sequence of requests with each request served by the server immediately.
  309. /// As one request could lead to multiple responses, this interface
  310. /// demonstrates the idea of full duplexing.
  311. func fullDuplexCall(request: ServerRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>
  312. /// A sequence of requests followed by a sequence of responses.
  313. /// The server buffers all the client requests and then serves them in order. A
  314. /// stream of responses are returned to the client when the server starts with
  315. /// first request.
  316. func halfDuplexCall(request: ServerRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>
  317. /// The test server will not implement this method. It will be used
  318. /// to test the behavior when clients call unimplemented methods.
  319. func unimplementedCall(request: ServerRequest.Single<Grpc_Testing_Empty>) async throws -> ServerResponse.Single<Grpc_Testing_Empty>
  320. }
  321. /// Partial conformance to `Grpc_Testing_TestServiceStreamingServiceProtocol`.
  322. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  323. extension Grpc_Testing_TestService.ServiceProtocol {
  324. public func emptyCall(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty> {
  325. let response = try await self.emptyCall(request: ServerRequest.Single(stream: request))
  326. return ServerResponse.Stream(single: response)
  327. }
  328. public func unaryCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
  329. let response = try await self.unaryCall(request: ServerRequest.Single(stream: request))
  330. return ServerResponse.Stream(single: response)
  331. }
  332. public func cacheableUnaryCall(request: ServerRequest.Stream<Grpc_Testing_SimpleRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_SimpleResponse> {
  333. let response = try await self.cacheableUnaryCall(request: ServerRequest.Single(stream: request))
  334. return ServerResponse.Stream(single: response)
  335. }
  336. public func streamingOutputCall(request: ServerRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingOutputCallResponse> {
  337. let response = try await self.streamingOutputCall(request: ServerRequest.Single(stream: request))
  338. return response
  339. }
  340. public func streamingInputCall(request: ServerRequest.Stream<Grpc_Testing_StreamingInputCallRequest>) async throws -> ServerResponse.Stream<Grpc_Testing_StreamingInputCallResponse> {
  341. let response = try await self.streamingInputCall(request: request)
  342. return ServerResponse.Stream(single: response)
  343. }
  344. public func unimplementedCall(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty> {
  345. let response = try await self.unimplementedCall(request: ServerRequest.Single(stream: request))
  346. return ServerResponse.Stream(single: response)
  347. }
  348. }
  349. /// A simple service NOT implemented at servers so clients can test for
  350. /// that case.
  351. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  352. public protocol Grpc_Testing_UnimplementedServiceStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
  353. /// A call that no server should implement
  354. func unimplementedCall(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty>
  355. }
  356. /// Conformance to `GRPCCore.RegistrableRPCService`.
  357. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  358. extension Grpc_Testing_UnimplementedService.StreamingServiceProtocol {
  359. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  360. public func registerMethods(with router: inout GRPCCore.RPCRouter) {
  361. router.registerHandler(
  362. forMethod: Grpc_Testing_UnimplementedService.Method.UnimplementedCall.descriptor,
  363. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  364. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  365. handler: { request in
  366. try await self.unimplementedCall(request: request)
  367. }
  368. )
  369. }
  370. }
  371. /// A simple service NOT implemented at servers so clients can test for
  372. /// that case.
  373. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  374. public protocol Grpc_Testing_UnimplementedServiceServiceProtocol: Grpc_Testing_UnimplementedService.StreamingServiceProtocol {
  375. /// A call that no server should implement
  376. func unimplementedCall(request: ServerRequest.Single<Grpc_Testing_Empty>) async throws -> ServerResponse.Single<Grpc_Testing_Empty>
  377. }
  378. /// Partial conformance to `Grpc_Testing_UnimplementedServiceStreamingServiceProtocol`.
  379. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  380. extension Grpc_Testing_UnimplementedService.ServiceProtocol {
  381. public func unimplementedCall(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty> {
  382. let response = try await self.unimplementedCall(request: ServerRequest.Single(stream: request))
  383. return ServerResponse.Stream(single: response)
  384. }
  385. }
  386. /// A service used to control reconnect server.
  387. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  388. public protocol Grpc_Testing_ReconnectServiceStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
  389. func start(request: ServerRequest.Stream<Grpc_Testing_ReconnectParams>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty>
  390. func stop(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_ReconnectInfo>
  391. }
  392. /// Conformance to `GRPCCore.RegistrableRPCService`.
  393. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  394. extension Grpc_Testing_ReconnectService.StreamingServiceProtocol {
  395. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  396. public func registerMethods(with router: inout GRPCCore.RPCRouter) {
  397. router.registerHandler(
  398. forMethod: Grpc_Testing_ReconnectService.Method.Start.descriptor,
  399. deserializer: ProtobufDeserializer<Grpc_Testing_ReconnectParams>(),
  400. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  401. handler: { request in
  402. try await self.start(request: request)
  403. }
  404. )
  405. router.registerHandler(
  406. forMethod: Grpc_Testing_ReconnectService.Method.Stop.descriptor,
  407. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  408. serializer: ProtobufSerializer<Grpc_Testing_ReconnectInfo>(),
  409. handler: { request in
  410. try await self.stop(request: request)
  411. }
  412. )
  413. }
  414. }
  415. /// A service used to control reconnect server.
  416. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  417. public protocol Grpc_Testing_ReconnectServiceServiceProtocol: Grpc_Testing_ReconnectService.StreamingServiceProtocol {
  418. func start(request: ServerRequest.Single<Grpc_Testing_ReconnectParams>) async throws -> ServerResponse.Single<Grpc_Testing_Empty>
  419. func stop(request: ServerRequest.Single<Grpc_Testing_Empty>) async throws -> ServerResponse.Single<Grpc_Testing_ReconnectInfo>
  420. }
  421. /// Partial conformance to `Grpc_Testing_ReconnectServiceStreamingServiceProtocol`.
  422. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  423. extension Grpc_Testing_ReconnectService.ServiceProtocol {
  424. public func start(request: ServerRequest.Stream<Grpc_Testing_ReconnectParams>) async throws -> ServerResponse.Stream<Grpc_Testing_Empty> {
  425. let response = try await self.start(request: ServerRequest.Single(stream: request))
  426. return ServerResponse.Stream(single: response)
  427. }
  428. public func stop(request: ServerRequest.Stream<Grpc_Testing_Empty>) async throws -> ServerResponse.Stream<Grpc_Testing_ReconnectInfo> {
  429. let response = try await self.stop(request: ServerRequest.Single(stream: request))
  430. return ServerResponse.Stream(single: response)
  431. }
  432. }
  433. /// A simple service to test the various types of RPCs and experiment with
  434. /// performance with various types of payload.
  435. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  436. public protocol Grpc_Testing_TestServiceClientProtocol: Sendable {
  437. /// One empty request followed by one empty response.
  438. func emptyCall<R>(
  439. request: ClientRequest.Single<Grpc_Testing_Empty>,
  440. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  441. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  442. options: CallOptions,
  443. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  444. ) async throws -> R where R: Sendable
  445. /// One request followed by one response.
  446. func unaryCall<R>(
  447. request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
  448. serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
  449. deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
  450. options: CallOptions,
  451. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
  452. ) async throws -> R where R: Sendable
  453. /// One request followed by one response. Response has cache control
  454. /// headers set such that a caching HTTP proxy (such as GFE) can
  455. /// satisfy subsequent requests.
  456. func cacheableUnaryCall<R>(
  457. request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
  458. serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
  459. deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
  460. options: CallOptions,
  461. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
  462. ) async throws -> R where R: Sendable
  463. /// One request followed by a sequence of responses (streamed download).
  464. /// The server returns the payload with client desired type and sizes.
  465. func streamingOutputCall<R>(
  466. request: ClientRequest.Single<Grpc_Testing_StreamingOutputCallRequest>,
  467. serializer: some MessageSerializer<Grpc_Testing_StreamingOutputCallRequest>,
  468. deserializer: some MessageDeserializer<Grpc_Testing_StreamingOutputCallResponse>,
  469. options: CallOptions,
  470. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  471. ) async throws -> R where R: Sendable
  472. /// A sequence of requests followed by one response (streamed upload).
  473. /// The server returns the aggregated size of client payload as the result.
  474. func streamingInputCall<R>(
  475. request: ClientRequest.Stream<Grpc_Testing_StreamingInputCallRequest>,
  476. serializer: some MessageSerializer<Grpc_Testing_StreamingInputCallRequest>,
  477. deserializer: some MessageDeserializer<Grpc_Testing_StreamingInputCallResponse>,
  478. options: CallOptions,
  479. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_StreamingInputCallResponse>) async throws -> R
  480. ) async throws -> R where R: Sendable
  481. /// A sequence of requests with each request served by the server immediately.
  482. /// As one request could lead to multiple responses, this interface
  483. /// demonstrates the idea of full duplexing.
  484. func fullDuplexCall<R>(
  485. request: ClientRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>,
  486. serializer: some MessageSerializer<Grpc_Testing_StreamingOutputCallRequest>,
  487. deserializer: some MessageDeserializer<Grpc_Testing_StreamingOutputCallResponse>,
  488. options: CallOptions,
  489. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  490. ) async throws -> R where R: Sendable
  491. /// A sequence of requests followed by a sequence of responses.
  492. /// The server buffers all the client requests and then serves them in order. A
  493. /// stream of responses are returned to the client when the server starts with
  494. /// first request.
  495. func halfDuplexCall<R>(
  496. request: ClientRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>,
  497. serializer: some MessageSerializer<Grpc_Testing_StreamingOutputCallRequest>,
  498. deserializer: some MessageDeserializer<Grpc_Testing_StreamingOutputCallResponse>,
  499. options: CallOptions,
  500. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  501. ) async throws -> R where R: Sendable
  502. /// The test server will not implement this method. It will be used
  503. /// to test the behavior when clients call unimplemented methods.
  504. func unimplementedCall<R>(
  505. request: ClientRequest.Single<Grpc_Testing_Empty>,
  506. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  507. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  508. options: CallOptions,
  509. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  510. ) async throws -> R where R: Sendable
  511. }
  512. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  513. extension Grpc_Testing_TestService.ClientProtocol {
  514. public func emptyCall<R>(
  515. request: ClientRequest.Single<Grpc_Testing_Empty>,
  516. options: CallOptions = .defaults,
  517. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  518. ) async throws -> R where R: Sendable {
  519. try await self.emptyCall(
  520. request: request,
  521. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  522. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  523. options: options,
  524. body
  525. )
  526. }
  527. public func unaryCall<R>(
  528. request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
  529. options: CallOptions = .defaults,
  530. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
  531. ) async throws -> R where R: Sendable {
  532. try await self.unaryCall(
  533. request: request,
  534. serializer: ProtobufSerializer<Grpc_Testing_SimpleRequest>(),
  535. deserializer: ProtobufDeserializer<Grpc_Testing_SimpleResponse>(),
  536. options: options,
  537. body
  538. )
  539. }
  540. public func cacheableUnaryCall<R>(
  541. request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
  542. options: CallOptions = .defaults,
  543. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
  544. ) async throws -> R where R: Sendable {
  545. try await self.cacheableUnaryCall(
  546. request: request,
  547. serializer: ProtobufSerializer<Grpc_Testing_SimpleRequest>(),
  548. deserializer: ProtobufDeserializer<Grpc_Testing_SimpleResponse>(),
  549. options: options,
  550. body
  551. )
  552. }
  553. public func streamingOutputCall<R>(
  554. request: ClientRequest.Single<Grpc_Testing_StreamingOutputCallRequest>,
  555. options: CallOptions = .defaults,
  556. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  557. ) async throws -> R where R: Sendable {
  558. try await self.streamingOutputCall(
  559. request: request,
  560. serializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallRequest>(),
  561. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallResponse>(),
  562. options: options,
  563. body
  564. )
  565. }
  566. public func streamingInputCall<R>(
  567. request: ClientRequest.Stream<Grpc_Testing_StreamingInputCallRequest>,
  568. options: CallOptions = .defaults,
  569. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_StreamingInputCallResponse>) async throws -> R
  570. ) async throws -> R where R: Sendable {
  571. try await self.streamingInputCall(
  572. request: request,
  573. serializer: ProtobufSerializer<Grpc_Testing_StreamingInputCallRequest>(),
  574. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingInputCallResponse>(),
  575. options: options,
  576. body
  577. )
  578. }
  579. public func fullDuplexCall<R>(
  580. request: ClientRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>,
  581. options: CallOptions = .defaults,
  582. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  583. ) async throws -> R where R: Sendable {
  584. try await self.fullDuplexCall(
  585. request: request,
  586. serializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallRequest>(),
  587. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallResponse>(),
  588. options: options,
  589. body
  590. )
  591. }
  592. public func halfDuplexCall<R>(
  593. request: ClientRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>,
  594. options: CallOptions = .defaults,
  595. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  596. ) async throws -> R where R: Sendable {
  597. try await self.halfDuplexCall(
  598. request: request,
  599. serializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallRequest>(),
  600. deserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallResponse>(),
  601. options: options,
  602. body
  603. )
  604. }
  605. public func unimplementedCall<R>(
  606. request: ClientRequest.Single<Grpc_Testing_Empty>,
  607. options: CallOptions = .defaults,
  608. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  609. ) async throws -> R where R: Sendable {
  610. try await self.unimplementedCall(
  611. request: request,
  612. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  613. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  614. options: options,
  615. body
  616. )
  617. }
  618. }
  619. /// A simple service to test the various types of RPCs and experiment with
  620. /// performance with various types of payload.
  621. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  622. public struct Grpc_Testing_TestServiceClient: Grpc_Testing_TestService.ClientProtocol {
  623. private let client: GRPCCore.GRPCClient
  624. public init(wrapping client: GRPCCore.GRPCClient) {
  625. self.client = client
  626. }
  627. /// One empty request followed by one empty response.
  628. public func emptyCall<R>(
  629. request: ClientRequest.Single<Grpc_Testing_Empty>,
  630. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  631. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  632. options: CallOptions = .defaults,
  633. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  634. ) async throws -> R where R: Sendable {
  635. try await self.client.unary(
  636. request: request,
  637. descriptor: Grpc_Testing_TestService.Method.EmptyCall.descriptor,
  638. serializer: serializer,
  639. deserializer: deserializer,
  640. options: options,
  641. handler: body
  642. )
  643. }
  644. /// One request followed by one response.
  645. public func unaryCall<R>(
  646. request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
  647. serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
  648. deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
  649. options: CallOptions = .defaults,
  650. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
  651. ) async throws -> R where R: Sendable {
  652. try await self.client.unary(
  653. request: request,
  654. descriptor: Grpc_Testing_TestService.Method.UnaryCall.descriptor,
  655. serializer: serializer,
  656. deserializer: deserializer,
  657. options: options,
  658. handler: body
  659. )
  660. }
  661. /// One request followed by one response. Response has cache control
  662. /// headers set such that a caching HTTP proxy (such as GFE) can
  663. /// satisfy subsequent requests.
  664. public func cacheableUnaryCall<R>(
  665. request: ClientRequest.Single<Grpc_Testing_SimpleRequest>,
  666. serializer: some MessageSerializer<Grpc_Testing_SimpleRequest>,
  667. deserializer: some MessageDeserializer<Grpc_Testing_SimpleResponse>,
  668. options: CallOptions = .defaults,
  669. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_SimpleResponse>) async throws -> R
  670. ) async throws -> R where R: Sendable {
  671. try await self.client.unary(
  672. request: request,
  673. descriptor: Grpc_Testing_TestService.Method.CacheableUnaryCall.descriptor,
  674. serializer: serializer,
  675. deserializer: deserializer,
  676. options: options,
  677. handler: body
  678. )
  679. }
  680. /// One request followed by a sequence of responses (streamed download).
  681. /// The server returns the payload with client desired type and sizes.
  682. public func streamingOutputCall<R>(
  683. request: ClientRequest.Single<Grpc_Testing_StreamingOutputCallRequest>,
  684. serializer: some MessageSerializer<Grpc_Testing_StreamingOutputCallRequest>,
  685. deserializer: some MessageDeserializer<Grpc_Testing_StreamingOutputCallResponse>,
  686. options: CallOptions = .defaults,
  687. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  688. ) async throws -> R where R: Sendable {
  689. try await self.client.serverStreaming(
  690. request: request,
  691. descriptor: Grpc_Testing_TestService.Method.StreamingOutputCall.descriptor,
  692. serializer: serializer,
  693. deserializer: deserializer,
  694. options: options,
  695. handler: body
  696. )
  697. }
  698. /// A sequence of requests followed by one response (streamed upload).
  699. /// The server returns the aggregated size of client payload as the result.
  700. public func streamingInputCall<R>(
  701. request: ClientRequest.Stream<Grpc_Testing_StreamingInputCallRequest>,
  702. serializer: some MessageSerializer<Grpc_Testing_StreamingInputCallRequest>,
  703. deserializer: some MessageDeserializer<Grpc_Testing_StreamingInputCallResponse>,
  704. options: CallOptions = .defaults,
  705. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_StreamingInputCallResponse>) async throws -> R
  706. ) async throws -> R where R: Sendable {
  707. try await self.client.clientStreaming(
  708. request: request,
  709. descriptor: Grpc_Testing_TestService.Method.StreamingInputCall.descriptor,
  710. serializer: serializer,
  711. deserializer: deserializer,
  712. options: options,
  713. handler: body
  714. )
  715. }
  716. /// A sequence of requests with each request served by the server immediately.
  717. /// As one request could lead to multiple responses, this interface
  718. /// demonstrates the idea of full duplexing.
  719. public func fullDuplexCall<R>(
  720. request: ClientRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>,
  721. serializer: some MessageSerializer<Grpc_Testing_StreamingOutputCallRequest>,
  722. deserializer: some MessageDeserializer<Grpc_Testing_StreamingOutputCallResponse>,
  723. options: CallOptions = .defaults,
  724. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  725. ) async throws -> R where R: Sendable {
  726. try await self.client.bidirectionalStreaming(
  727. request: request,
  728. descriptor: Grpc_Testing_TestService.Method.FullDuplexCall.descriptor,
  729. serializer: serializer,
  730. deserializer: deserializer,
  731. options: options,
  732. handler: body
  733. )
  734. }
  735. /// A sequence of requests followed by a sequence of responses.
  736. /// The server buffers all the client requests and then serves them in order. A
  737. /// stream of responses are returned to the client when the server starts with
  738. /// first request.
  739. public func halfDuplexCall<R>(
  740. request: ClientRequest.Stream<Grpc_Testing_StreamingOutputCallRequest>,
  741. serializer: some MessageSerializer<Grpc_Testing_StreamingOutputCallRequest>,
  742. deserializer: some MessageDeserializer<Grpc_Testing_StreamingOutputCallResponse>,
  743. options: CallOptions = .defaults,
  744. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_StreamingOutputCallResponse>) async throws -> R
  745. ) async throws -> R where R: Sendable {
  746. try await self.client.bidirectionalStreaming(
  747. request: request,
  748. descriptor: Grpc_Testing_TestService.Method.HalfDuplexCall.descriptor,
  749. serializer: serializer,
  750. deserializer: deserializer,
  751. options: options,
  752. handler: body
  753. )
  754. }
  755. /// The test server will not implement this method. It will be used
  756. /// to test the behavior when clients call unimplemented methods.
  757. public func unimplementedCall<R>(
  758. request: ClientRequest.Single<Grpc_Testing_Empty>,
  759. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  760. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  761. options: CallOptions = .defaults,
  762. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  763. ) async throws -> R where R: Sendable {
  764. try await self.client.unary(
  765. request: request,
  766. descriptor: Grpc_Testing_TestService.Method.UnimplementedCall.descriptor,
  767. serializer: serializer,
  768. deserializer: deserializer,
  769. options: options,
  770. handler: body
  771. )
  772. }
  773. }
  774. /// A simple service NOT implemented at servers so clients can test for
  775. /// that case.
  776. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  777. public protocol Grpc_Testing_UnimplementedServiceClientProtocol: Sendable {
  778. /// A call that no server should implement
  779. func unimplementedCall<R>(
  780. request: ClientRequest.Single<Grpc_Testing_Empty>,
  781. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  782. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  783. options: CallOptions,
  784. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  785. ) async throws -> R where R: Sendable
  786. }
  787. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  788. extension Grpc_Testing_UnimplementedService.ClientProtocol {
  789. public func unimplementedCall<R>(
  790. request: ClientRequest.Single<Grpc_Testing_Empty>,
  791. options: CallOptions = .defaults,
  792. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  793. ) async throws -> R where R: Sendable {
  794. try await self.unimplementedCall(
  795. request: request,
  796. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  797. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  798. options: options,
  799. body
  800. )
  801. }
  802. }
  803. /// A simple service NOT implemented at servers so clients can test for
  804. /// that case.
  805. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  806. public struct Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_UnimplementedService.ClientProtocol {
  807. private let client: GRPCCore.GRPCClient
  808. public init(wrapping client: GRPCCore.GRPCClient) {
  809. self.client = client
  810. }
  811. /// A call that no server should implement
  812. public func unimplementedCall<R>(
  813. request: ClientRequest.Single<Grpc_Testing_Empty>,
  814. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  815. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  816. options: CallOptions = .defaults,
  817. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  818. ) async throws -> R where R: Sendable {
  819. try await self.client.unary(
  820. request: request,
  821. descriptor: Grpc_Testing_UnimplementedService.Method.UnimplementedCall.descriptor,
  822. serializer: serializer,
  823. deserializer: deserializer,
  824. options: options,
  825. handler: body
  826. )
  827. }
  828. }
  829. /// A service used to control reconnect server.
  830. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  831. public protocol Grpc_Testing_ReconnectServiceClientProtocol: Sendable {
  832. func start<R>(
  833. request: ClientRequest.Single<Grpc_Testing_ReconnectParams>,
  834. serializer: some MessageSerializer<Grpc_Testing_ReconnectParams>,
  835. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  836. options: CallOptions,
  837. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  838. ) async throws -> R where R: Sendable
  839. func stop<R>(
  840. request: ClientRequest.Single<Grpc_Testing_Empty>,
  841. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  842. deserializer: some MessageDeserializer<Grpc_Testing_ReconnectInfo>,
  843. options: CallOptions,
  844. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_ReconnectInfo>) async throws -> R
  845. ) async throws -> R where R: Sendable
  846. }
  847. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  848. extension Grpc_Testing_ReconnectService.ClientProtocol {
  849. public func start<R>(
  850. request: ClientRequest.Single<Grpc_Testing_ReconnectParams>,
  851. options: CallOptions = .defaults,
  852. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  853. ) async throws -> R where R: Sendable {
  854. try await self.start(
  855. request: request,
  856. serializer: ProtobufSerializer<Grpc_Testing_ReconnectParams>(),
  857. deserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
  858. options: options,
  859. body
  860. )
  861. }
  862. public func stop<R>(
  863. request: ClientRequest.Single<Grpc_Testing_Empty>,
  864. options: CallOptions = .defaults,
  865. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_ReconnectInfo>) async throws -> R
  866. ) async throws -> R where R: Sendable {
  867. try await self.stop(
  868. request: request,
  869. serializer: ProtobufSerializer<Grpc_Testing_Empty>(),
  870. deserializer: ProtobufDeserializer<Grpc_Testing_ReconnectInfo>(),
  871. options: options,
  872. body
  873. )
  874. }
  875. }
  876. /// A service used to control reconnect server.
  877. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
  878. public struct Grpc_Testing_ReconnectServiceClient: Grpc_Testing_ReconnectService.ClientProtocol {
  879. private let client: GRPCCore.GRPCClient
  880. public init(wrapping client: GRPCCore.GRPCClient) {
  881. self.client = client
  882. }
  883. public func start<R>(
  884. request: ClientRequest.Single<Grpc_Testing_ReconnectParams>,
  885. serializer: some MessageSerializer<Grpc_Testing_ReconnectParams>,
  886. deserializer: some MessageDeserializer<Grpc_Testing_Empty>,
  887. options: CallOptions = .defaults,
  888. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_Empty>) async throws -> R
  889. ) async throws -> R where R: Sendable {
  890. try await self.client.unary(
  891. request: request,
  892. descriptor: Grpc_Testing_ReconnectService.Method.Start.descriptor,
  893. serializer: serializer,
  894. deserializer: deserializer,
  895. options: options,
  896. handler: body
  897. )
  898. }
  899. public func stop<R>(
  900. request: ClientRequest.Single<Grpc_Testing_Empty>,
  901. serializer: some MessageSerializer<Grpc_Testing_Empty>,
  902. deserializer: some MessageDeserializer<Grpc_Testing_ReconnectInfo>,
  903. options: CallOptions = .defaults,
  904. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_ReconnectInfo>) async throws -> R
  905. ) async throws -> R where R: Sendable {
  906. try await self.client.unary(
  907. request: request,
  908. descriptor: Grpc_Testing_ReconnectService.Method.Stop.descriptor,
  909. serializer: serializer,
  910. deserializer: deserializer,
  911. options: options,
  912. handler: body
  913. )
  914. }
  915. }