| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757 |
- //
- // DO NOT EDIT.
- //
- // Generated by the protocol buffer compiler.
- // Source: src/proto/grpc/testing/test.proto
- //
- //
- // Copyright 2018, gRPC Authors All rights reserved.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- //
- import GRPC
- import NIO
- import NIOConcurrencyHelpers
- import SwiftProtobuf
- /// A simple service to test the various types of RPCs and experiment with
- /// performance with various types of payload.
- ///
- /// Usage: instantiate `Grpc_Testing_TestServiceClient`, then call methods of this protocol to make API calls.
- public protocol Grpc_Testing_TestServiceClientProtocol: GRPCClient {
- var serviceName: String { get }
- var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? { get }
- func emptyCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
- func unaryCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions?
- ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
- func cacheableUnaryCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions?
- ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
- func streamingOutputCall(
- _ request: Grpc_Testing_StreamingOutputCallRequest,
- callOptions: CallOptions?,
- handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
- ) -> ServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
- func streamingInputCall(
- callOptions: CallOptions?
- ) -> ClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>
- func fullDuplexCall(
- callOptions: CallOptions?,
- handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
- ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
- func halfDuplexCall(
- callOptions: CallOptions?,
- handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
- ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
- func unimplementedCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
- }
- extension Grpc_Testing_TestServiceClientProtocol {
- public var serviceName: String {
- return "grpc.testing.TestService"
- }
- /// One empty request followed by one empty response.
- ///
- /// - Parameters:
- /// - request: Request to send to EmptyCall.
- /// - callOptions: Call options.
- /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
- public func emptyCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
- return self.makeUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.emptyCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? []
- )
- }
- /// One request followed by one response.
- ///
- /// - Parameters:
- /// - request: Request to send to UnaryCall.
- /// - callOptions: Call options.
- /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
- public func unaryCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions? = nil
- ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
- return self.makeUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.unaryCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? []
- )
- }
- /// One request followed by one response. Response has cache control
- /// headers set such that a caching HTTP proxy (such as GFE) can
- /// satisfy subsequent requests.
- ///
- /// - Parameters:
- /// - request: Request to send to CacheableUnaryCall.
- /// - callOptions: Call options.
- /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
- public func cacheableUnaryCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions? = nil
- ) -> UnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
- return self.makeUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.cacheableUnaryCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? []
- )
- }
- /// One request followed by a sequence of responses (streamed download).
- /// The server returns the payload with client desired type and sizes.
- ///
- /// - Parameters:
- /// - request: Request to send to StreamingOutputCall.
- /// - callOptions: Call options.
- /// - handler: A closure called when each response is received from the server.
- /// - Returns: A `ServerStreamingCall` with futures for the metadata and status.
- public func streamingOutputCall(
- _ request: Grpc_Testing_StreamingOutputCallRequest,
- callOptions: CallOptions? = nil,
- handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
- ) -> ServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
- return self.makeServerStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.streamingOutputCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? [],
- handler: handler
- )
- }
- /// A sequence of requests followed by one response (streamed upload).
- /// The server returns the aggregated size of client payload as the result.
- ///
- /// Callers should use the `send` method on the returned object to send messages
- /// to the server. The caller should send an `.end` after the final message has been sent.
- ///
- /// - Parameters:
- /// - callOptions: Call options.
- /// - Returns: A `ClientStreamingCall` with futures for the metadata, status and response.
- public func streamingInputCall(
- callOptions: CallOptions? = nil
- ) -> ClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse> {
- return self.makeClientStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.streamingInputCall.path,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
- )
- }
- /// A sequence of requests with each request served by the server immediately.
- /// As one request could lead to multiple responses, this interface
- /// demonstrates the idea of full duplexing.
- ///
- /// Callers should use the `send` method on the returned object to send messages
- /// to the server. The caller should send an `.end` after the final message has been sent.
- ///
- /// - Parameters:
- /// - callOptions: Call options.
- /// - handler: A closure called when each response is received from the server.
- /// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
- public func fullDuplexCall(
- callOptions: CallOptions? = nil,
- handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
- ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
- return self.makeBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.fullDuplexCall.path,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? [],
- handler: handler
- )
- }
- /// A sequence of requests followed by a sequence of responses.
- /// The server buffers all the client requests and then serves them in order. A
- /// stream of responses are returned to the client when the server starts with
- /// first request.
- ///
- /// Callers should use the `send` method on the returned object to send messages
- /// to the server. The caller should send an `.end` after the final message has been sent.
- ///
- /// - Parameters:
- /// - callOptions: Call options.
- /// - handler: A closure called when each response is received from the server.
- /// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
- public func halfDuplexCall(
- callOptions: CallOptions? = nil,
- handler: @escaping (Grpc_Testing_StreamingOutputCallResponse) -> Void
- ) -> BidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
- return self.makeBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.halfDuplexCall.path,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? [],
- handler: handler
- )
- }
- /// The test server will not implement this method. It will be used
- /// to test the behavior when clients call unimplemented methods.
- ///
- /// - Parameters:
- /// - request: Request to send to UnimplementedCall.
- /// - callOptions: Call options.
- /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
- public func unimplementedCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
- return self.makeUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.unimplementedCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
- )
- }
- }
- @available(*, deprecated)
- extension Grpc_Testing_TestServiceClient: @unchecked Sendable {}
- @available(*, deprecated, renamed: "Grpc_Testing_TestServiceNIOClient")
- public final class Grpc_Testing_TestServiceClient: Grpc_Testing_TestServiceClientProtocol {
- private let lock = Lock()
- private var _defaultCallOptions: CallOptions
- private var _interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol?
- public let channel: GRPCChannel
- public var defaultCallOptions: CallOptions {
- get { self.lock.withLock { return self._defaultCallOptions } }
- set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
- }
- public var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? {
- get { self.lock.withLock { return self._interceptors } }
- set { self.lock.withLockVoid { self._interceptors = newValue } }
- }
- /// Creates a client for the grpc.testing.TestService service.
- ///
- /// - Parameters:
- /// - channel: `GRPCChannel` to the service host.
- /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
- /// - interceptors: A factory providing interceptors for each RPC.
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self._defaultCallOptions = defaultCallOptions
- self._interceptors = interceptors
- }
- }
- public struct Grpc_Testing_TestServiceNIOClient: Grpc_Testing_TestServiceClientProtocol {
- public var channel: GRPCChannel
- public var defaultCallOptions: CallOptions
- public var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol?
- /// Creates a client for the grpc.testing.TestService service.
- ///
- /// - Parameters:
- /// - channel: `GRPCChannel` to the service host.
- /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
- /// - interceptors: A factory providing interceptors for each RPC.
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self.defaultCallOptions = defaultCallOptions
- self.interceptors = interceptors
- }
- }
- /// A simple service to test the various types of RPCs and experiment with
- /// performance with various types of payload.
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public protocol Grpc_Testing_TestServiceAsyncClientProtocol: GRPCClient {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? { get }
- func makeEmptyCallCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
- func makeUnaryCallCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions?
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
- func makeCacheableUnaryCallCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions?
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>
- func makeStreamingOutputCallCall(
- _ request: Grpc_Testing_StreamingOutputCallRequest,
- callOptions: CallOptions?
- ) -> GRPCAsyncServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
- func makeStreamingInputCallCall(
- callOptions: CallOptions?
- ) -> GRPCAsyncClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>
- func makeFullDuplexCallCall(
- callOptions: CallOptions?
- ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
- func makeHalfDuplexCallCall(
- callOptions: CallOptions?
- ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>
- func makeUnimplementedCallCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_TestServiceAsyncClientProtocol {
- public static var serviceDescriptor: GRPCServiceDescriptor {
- return Grpc_Testing_TestServiceClientMetadata.serviceDescriptor
- }
- public var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? {
- return nil
- }
- public func makeEmptyCallCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
- return self.makeAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.emptyCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? []
- )
- }
- public func makeUnaryCallCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
- return self.makeAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.unaryCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? []
- )
- }
- public func makeCacheableUnaryCallCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse> {
- return self.makeAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.cacheableUnaryCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? []
- )
- }
- public func makeStreamingOutputCallCall(
- _ request: Grpc_Testing_StreamingOutputCallRequest,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncServerStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
- return self.makeAsyncServerStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.streamingOutputCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? []
- )
- }
- public func makeStreamingInputCallCall(
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncClientStreamingCall<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse> {
- return self.makeAsyncClientStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.streamingInputCall.path,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
- )
- }
- public func makeFullDuplexCallCall(
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
- return self.makeAsyncBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.fullDuplexCall.path,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? []
- )
- }
- public func makeHalfDuplexCallCall(
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncBidirectionalStreamingCall<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse> {
- return self.makeAsyncBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.halfDuplexCall.path,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? []
- )
- }
- public func makeUnimplementedCallCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
- return self.makeAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.unimplementedCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
- )
- }
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_TestServiceAsyncClientProtocol {
- public func emptyCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_Empty {
- return try await self.performAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.emptyCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? []
- )
- }
- public func unaryCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_SimpleResponse {
- return try await self.performAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.unaryCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? []
- )
- }
- public func cacheableUnaryCall(
- _ request: Grpc_Testing_SimpleRequest,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_SimpleResponse {
- return try await self.performAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.cacheableUnaryCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? []
- )
- }
- public func streamingOutputCall(
- _ request: Grpc_Testing_StreamingOutputCallRequest,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> {
- return self.performAsyncServerStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.streamingOutputCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? []
- )
- }
- public func streamingInputCall<RequestStream>(
- _ requests: RequestStream,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_StreamingInputCallResponse where RequestStream: Sequence, RequestStream.Element == Grpc_Testing_StreamingInputCallRequest {
- return try await self.performAsyncClientStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.streamingInputCall.path,
- requests: requests,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
- )
- }
- public func streamingInputCall<RequestStream>(
- _ requests: RequestStream,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_StreamingInputCallResponse where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Grpc_Testing_StreamingInputCallRequest {
- return try await self.performAsyncClientStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.streamingInputCall.path,
- requests: requests,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? []
- )
- }
- public func fullDuplexCall<RequestStream>(
- _ requests: RequestStream,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: Sequence, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
- return self.performAsyncBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.fullDuplexCall.path,
- requests: requests,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? []
- )
- }
- public func fullDuplexCall<RequestStream>(
- _ requests: RequestStream,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
- return self.performAsyncBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.fullDuplexCall.path,
- requests: requests,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? []
- )
- }
- public func halfDuplexCall<RequestStream>(
- _ requests: RequestStream,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: Sequence, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
- return self.performAsyncBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.halfDuplexCall.path,
- requests: requests,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? []
- )
- }
- public func halfDuplexCall<RequestStream>(
- _ requests: RequestStream,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncResponseStream<Grpc_Testing_StreamingOutputCallResponse> where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Grpc_Testing_StreamingOutputCallRequest {
- return self.performAsyncBidirectionalStreamingCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.halfDuplexCall.path,
- requests: requests,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? []
- )
- }
- public func unimplementedCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_Empty {
- return try await self.performAsyncUnaryCall(
- path: Grpc_Testing_TestServiceClientMetadata.Methods.unimplementedCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
- )
- }
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public struct Grpc_Testing_TestServiceAsyncClient: Grpc_Testing_TestServiceAsyncClientProtocol {
- public var channel: GRPCChannel
- public var defaultCallOptions: CallOptions
- public var interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol?
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_TestServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self.defaultCallOptions = defaultCallOptions
- self.interceptors = interceptors
- }
- }
- public protocol Grpc_Testing_TestServiceClientInterceptorFactoryProtocol: Sendable {
- /// - Returns: Interceptors to use when invoking 'emptyCall'.
- func makeEmptyCallInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
- /// - Returns: Interceptors to use when invoking 'unaryCall'.
- func makeUnaryCallInterceptors() -> [ClientInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
- /// - Returns: Interceptors to use when invoking 'cacheableUnaryCall'.
- func makeCacheableUnaryCallInterceptors() -> [ClientInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
- /// - Returns: Interceptors to use when invoking 'streamingOutputCall'.
- func makeStreamingOutputCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
- /// - Returns: Interceptors to use when invoking 'streamingInputCall'.
- func makeStreamingInputCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>]
- /// - Returns: Interceptors to use when invoking 'fullDuplexCall'.
- func makeFullDuplexCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
- /// - Returns: Interceptors to use when invoking 'halfDuplexCall'.
- func makeHalfDuplexCallInterceptors() -> [ClientInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
- /// - Returns: Interceptors to use when invoking 'unimplementedCall'.
- func makeUnimplementedCallInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
- }
- public enum Grpc_Testing_TestServiceClientMetadata {
- public static let serviceDescriptor = GRPCServiceDescriptor(
- name: "TestService",
- fullName: "grpc.testing.TestService",
- methods: [
- Grpc_Testing_TestServiceClientMetadata.Methods.emptyCall,
- Grpc_Testing_TestServiceClientMetadata.Methods.unaryCall,
- Grpc_Testing_TestServiceClientMetadata.Methods.cacheableUnaryCall,
- Grpc_Testing_TestServiceClientMetadata.Methods.streamingOutputCall,
- Grpc_Testing_TestServiceClientMetadata.Methods.streamingInputCall,
- Grpc_Testing_TestServiceClientMetadata.Methods.fullDuplexCall,
- Grpc_Testing_TestServiceClientMetadata.Methods.halfDuplexCall,
- Grpc_Testing_TestServiceClientMetadata.Methods.unimplementedCall,
- ]
- )
- public enum Methods {
- public static let emptyCall = GRPCMethodDescriptor(
- name: "EmptyCall",
- path: "/grpc.testing.TestService/EmptyCall",
- type: GRPCCallType.unary
- )
- public static let unaryCall = GRPCMethodDescriptor(
- name: "UnaryCall",
- path: "/grpc.testing.TestService/UnaryCall",
- type: GRPCCallType.unary
- )
- public static let cacheableUnaryCall = GRPCMethodDescriptor(
- name: "CacheableUnaryCall",
- path: "/grpc.testing.TestService/CacheableUnaryCall",
- type: GRPCCallType.unary
- )
- public static let streamingOutputCall = GRPCMethodDescriptor(
- name: "StreamingOutputCall",
- path: "/grpc.testing.TestService/StreamingOutputCall",
- type: GRPCCallType.serverStreaming
- )
- public static let streamingInputCall = GRPCMethodDescriptor(
- name: "StreamingInputCall",
- path: "/grpc.testing.TestService/StreamingInputCall",
- type: GRPCCallType.clientStreaming
- )
- public static let fullDuplexCall = GRPCMethodDescriptor(
- name: "FullDuplexCall",
- path: "/grpc.testing.TestService/FullDuplexCall",
- type: GRPCCallType.bidirectionalStreaming
- )
- public static let halfDuplexCall = GRPCMethodDescriptor(
- name: "HalfDuplexCall",
- path: "/grpc.testing.TestService/HalfDuplexCall",
- type: GRPCCallType.bidirectionalStreaming
- )
- public static let unimplementedCall = GRPCMethodDescriptor(
- name: "UnimplementedCall",
- path: "/grpc.testing.TestService/UnimplementedCall",
- type: GRPCCallType.unary
- )
- }
- }
- /// A simple service NOT implemented at servers so clients can test for
- /// that case.
- ///
- /// Usage: instantiate `Grpc_Testing_UnimplementedServiceClient`, then call methods of this protocol to make API calls.
- public protocol Grpc_Testing_UnimplementedServiceClientProtocol: GRPCClient {
- var serviceName: String { get }
- var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? { get }
- func unimplementedCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
- }
- extension Grpc_Testing_UnimplementedServiceClientProtocol {
- public var serviceName: String {
- return "grpc.testing.UnimplementedService"
- }
- /// A call that no server should implement
- ///
- /// - Parameters:
- /// - request: Request to send to UnimplementedCall.
- /// - callOptions: Call options.
- /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
- public func unimplementedCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
- return self.makeUnaryCall(
- path: Grpc_Testing_UnimplementedServiceClientMetadata.Methods.unimplementedCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
- )
- }
- }
- @available(*, deprecated)
- extension Grpc_Testing_UnimplementedServiceClient: @unchecked Sendable {}
- @available(*, deprecated, renamed: "Grpc_Testing_UnimplementedServiceNIOClient")
- public final class Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_UnimplementedServiceClientProtocol {
- private let lock = Lock()
- private var _defaultCallOptions: CallOptions
- private var _interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol?
- public let channel: GRPCChannel
- public var defaultCallOptions: CallOptions {
- get { self.lock.withLock { return self._defaultCallOptions } }
- set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
- }
- public var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? {
- get { self.lock.withLock { return self._interceptors } }
- set { self.lock.withLockVoid { self._interceptors = newValue } }
- }
- /// Creates a client for the grpc.testing.UnimplementedService service.
- ///
- /// - Parameters:
- /// - channel: `GRPCChannel` to the service host.
- /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
- /// - interceptors: A factory providing interceptors for each RPC.
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self._defaultCallOptions = defaultCallOptions
- self._interceptors = interceptors
- }
- }
- public struct Grpc_Testing_UnimplementedServiceNIOClient: Grpc_Testing_UnimplementedServiceClientProtocol {
- public var channel: GRPCChannel
- public var defaultCallOptions: CallOptions
- public var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol?
- /// Creates a client for the grpc.testing.UnimplementedService service.
- ///
- /// - Parameters:
- /// - channel: `GRPCChannel` to the service host.
- /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
- /// - interceptors: A factory providing interceptors for each RPC.
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self.defaultCallOptions = defaultCallOptions
- self.interceptors = interceptors
- }
- }
- /// A simple service NOT implemented at servers so clients can test for
- /// that case.
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public protocol Grpc_Testing_UnimplementedServiceAsyncClientProtocol: GRPCClient {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? { get }
- func makeUnimplementedCallCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty>
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_UnimplementedServiceAsyncClientProtocol {
- public static var serviceDescriptor: GRPCServiceDescriptor {
- return Grpc_Testing_UnimplementedServiceClientMetadata.serviceDescriptor
- }
- public var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? {
- return nil
- }
- public func makeUnimplementedCallCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_Empty> {
- return self.makeAsyncUnaryCall(
- path: Grpc_Testing_UnimplementedServiceClientMetadata.Methods.unimplementedCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
- )
- }
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_UnimplementedServiceAsyncClientProtocol {
- public func unimplementedCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_Empty {
- return try await self.performAsyncUnaryCall(
- path: Grpc_Testing_UnimplementedServiceClientMetadata.Methods.unimplementedCall.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? []
- )
- }
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public struct Grpc_Testing_UnimplementedServiceAsyncClient: Grpc_Testing_UnimplementedServiceAsyncClientProtocol {
- public var channel: GRPCChannel
- public var defaultCallOptions: CallOptions
- public var interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol?
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self.defaultCallOptions = defaultCallOptions
- self.interceptors = interceptors
- }
- }
- public protocol Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol: Sendable {
- /// - Returns: Interceptors to use when invoking 'unimplementedCall'.
- func makeUnimplementedCallInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
- }
- public enum Grpc_Testing_UnimplementedServiceClientMetadata {
- public static let serviceDescriptor = GRPCServiceDescriptor(
- name: "UnimplementedService",
- fullName: "grpc.testing.UnimplementedService",
- methods: [
- Grpc_Testing_UnimplementedServiceClientMetadata.Methods.unimplementedCall,
- ]
- )
- public enum Methods {
- public static let unimplementedCall = GRPCMethodDescriptor(
- name: "UnimplementedCall",
- path: "/grpc.testing.UnimplementedService/UnimplementedCall",
- type: GRPCCallType.unary
- )
- }
- }
- /// A service used to control reconnect server.
- ///
- /// Usage: instantiate `Grpc_Testing_ReconnectServiceClient`, then call methods of this protocol to make API calls.
- public protocol Grpc_Testing_ReconnectServiceClientProtocol: GRPCClient {
- var serviceName: String { get }
- var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? { get }
- func start(
- _ request: Grpc_Testing_ReconnectParams,
- callOptions: CallOptions?
- ) -> UnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>
- func stop(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>
- }
- extension Grpc_Testing_ReconnectServiceClientProtocol {
- public var serviceName: String {
- return "grpc.testing.ReconnectService"
- }
- /// Unary call to Start
- ///
- /// - Parameters:
- /// - request: Request to send to Start.
- /// - callOptions: Call options.
- /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
- public func start(
- _ request: Grpc_Testing_ReconnectParams,
- callOptions: CallOptions? = nil
- ) -> UnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty> {
- return self.makeUnaryCall(
- path: Grpc_Testing_ReconnectServiceClientMetadata.Methods.start.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStartInterceptors() ?? []
- )
- }
- /// Unary call to Stop
- ///
- /// - Parameters:
- /// - request: Request to send to Stop.
- /// - callOptions: Call options.
- /// - Returns: A `UnaryCall` with futures for the metadata, status and response.
- public func stop(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> UnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo> {
- return self.makeUnaryCall(
- path: Grpc_Testing_ReconnectServiceClientMetadata.Methods.stop.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStopInterceptors() ?? []
- )
- }
- }
- @available(*, deprecated)
- extension Grpc_Testing_ReconnectServiceClient: @unchecked Sendable {}
- @available(*, deprecated, renamed: "Grpc_Testing_ReconnectServiceNIOClient")
- public final class Grpc_Testing_ReconnectServiceClient: Grpc_Testing_ReconnectServiceClientProtocol {
- private let lock = Lock()
- private var _defaultCallOptions: CallOptions
- private var _interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol?
- public let channel: GRPCChannel
- public var defaultCallOptions: CallOptions {
- get { self.lock.withLock { return self._defaultCallOptions } }
- set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
- }
- public var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? {
- get { self.lock.withLock { return self._interceptors } }
- set { self.lock.withLockVoid { self._interceptors = newValue } }
- }
- /// Creates a client for the grpc.testing.ReconnectService service.
- ///
- /// - Parameters:
- /// - channel: `GRPCChannel` to the service host.
- /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
- /// - interceptors: A factory providing interceptors for each RPC.
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self._defaultCallOptions = defaultCallOptions
- self._interceptors = interceptors
- }
- }
- public struct Grpc_Testing_ReconnectServiceNIOClient: Grpc_Testing_ReconnectServiceClientProtocol {
- public var channel: GRPCChannel
- public var defaultCallOptions: CallOptions
- public var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol?
- /// Creates a client for the grpc.testing.ReconnectService service.
- ///
- /// - Parameters:
- /// - channel: `GRPCChannel` to the service host.
- /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
- /// - interceptors: A factory providing interceptors for each RPC.
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self.defaultCallOptions = defaultCallOptions
- self.interceptors = interceptors
- }
- }
- /// A service used to control reconnect server.
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public protocol Grpc_Testing_ReconnectServiceAsyncClientProtocol: GRPCClient {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? { get }
- func makeStartCall(
- _ request: Grpc_Testing_ReconnectParams,
- callOptions: CallOptions?
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>
- func makeStopCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions?
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_ReconnectServiceAsyncClientProtocol {
- public static var serviceDescriptor: GRPCServiceDescriptor {
- return Grpc_Testing_ReconnectServiceClientMetadata.serviceDescriptor
- }
- public var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? {
- return nil
- }
- public func makeStartCall(
- _ request: Grpc_Testing_ReconnectParams,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty> {
- return self.makeAsyncUnaryCall(
- path: Grpc_Testing_ReconnectServiceClientMetadata.Methods.start.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStartInterceptors() ?? []
- )
- }
- public func makeStopCall(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) -> GRPCAsyncUnaryCall<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo> {
- return self.makeAsyncUnaryCall(
- path: Grpc_Testing_ReconnectServiceClientMetadata.Methods.stop.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStopInterceptors() ?? []
- )
- }
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_ReconnectServiceAsyncClientProtocol {
- public func start(
- _ request: Grpc_Testing_ReconnectParams,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_Empty {
- return try await self.performAsyncUnaryCall(
- path: Grpc_Testing_ReconnectServiceClientMetadata.Methods.start.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStartInterceptors() ?? []
- )
- }
- public func stop(
- _ request: Grpc_Testing_Empty,
- callOptions: CallOptions? = nil
- ) async throws -> Grpc_Testing_ReconnectInfo {
- return try await self.performAsyncUnaryCall(
- path: Grpc_Testing_ReconnectServiceClientMetadata.Methods.stop.path,
- request: request,
- callOptions: callOptions ?? self.defaultCallOptions,
- interceptors: self.interceptors?.makeStopInterceptors() ?? []
- )
- }
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public struct Grpc_Testing_ReconnectServiceAsyncClient: Grpc_Testing_ReconnectServiceAsyncClientProtocol {
- public var channel: GRPCChannel
- public var defaultCallOptions: CallOptions
- public var interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol?
- public init(
- channel: GRPCChannel,
- defaultCallOptions: CallOptions = CallOptions(),
- interceptors: Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol? = nil
- ) {
- self.channel = channel
- self.defaultCallOptions = defaultCallOptions
- self.interceptors = interceptors
- }
- }
- public protocol Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol: Sendable {
- /// - Returns: Interceptors to use when invoking 'start'.
- func makeStartInterceptors() -> [ClientInterceptor<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>]
- /// - Returns: Interceptors to use when invoking 'stop'.
- func makeStopInterceptors() -> [ClientInterceptor<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>]
- }
- public enum Grpc_Testing_ReconnectServiceClientMetadata {
- public static let serviceDescriptor = GRPCServiceDescriptor(
- name: "ReconnectService",
- fullName: "grpc.testing.ReconnectService",
- methods: [
- Grpc_Testing_ReconnectServiceClientMetadata.Methods.start,
- Grpc_Testing_ReconnectServiceClientMetadata.Methods.stop,
- ]
- )
- public enum Methods {
- public static let start = GRPCMethodDescriptor(
- name: "Start",
- path: "/grpc.testing.ReconnectService/Start",
- type: GRPCCallType.unary
- )
- public static let stop = GRPCMethodDescriptor(
- name: "Stop",
- path: "/grpc.testing.ReconnectService/Stop",
- type: GRPCCallType.unary
- )
- }
- }
- /// A simple service to test the various types of RPCs and experiment with
- /// performance with various types of payload.
- ///
- /// To build a server, implement a class that conforms to this protocol.
- public protocol Grpc_Testing_TestServiceProvider: CallHandlerProvider {
- var interceptors: Grpc_Testing_TestServiceServerInterceptorFactoryProtocol? { get }
- /// One empty request followed by one empty response.
- func emptyCall(request: Grpc_Testing_Empty, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_Empty>
- /// One request followed by one response.
- func unaryCall(request: Grpc_Testing_SimpleRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_SimpleResponse>
- /// One request followed by one response. Response has cache control
- /// headers set such that a caching HTTP proxy (such as GFE) can
- /// satisfy subsequent requests.
- func cacheableUnaryCall(request: Grpc_Testing_SimpleRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_SimpleResponse>
- /// One request followed by a sequence of responses (streamed download).
- /// The server returns the payload with client desired type and sizes.
- func streamingOutputCall(request: Grpc_Testing_StreamingOutputCallRequest, context: StreamingResponseCallContext<Grpc_Testing_StreamingOutputCallResponse>) -> EventLoopFuture<GRPCStatus>
- /// A sequence of requests followed by one response (streamed upload).
- /// The server returns the aggregated size of client payload as the result.
- func streamingInputCall(context: UnaryResponseCallContext<Grpc_Testing_StreamingInputCallResponse>) -> EventLoopFuture<(StreamEvent<Grpc_Testing_StreamingInputCallRequest>) -> Void>
- /// A sequence of requests with each request served by the server immediately.
- /// As one request could lead to multiple responses, this interface
- /// demonstrates the idea of full duplexing.
- func fullDuplexCall(context: StreamingResponseCallContext<Grpc_Testing_StreamingOutputCallResponse>) -> EventLoopFuture<(StreamEvent<Grpc_Testing_StreamingOutputCallRequest>) -> Void>
- /// A sequence of requests followed by a sequence of responses.
- /// The server buffers all the client requests and then serves them in order. A
- /// stream of responses are returned to the client when the server starts with
- /// first request.
- func halfDuplexCall(context: StreamingResponseCallContext<Grpc_Testing_StreamingOutputCallResponse>) -> EventLoopFuture<(StreamEvent<Grpc_Testing_StreamingOutputCallRequest>) -> Void>
- }
- extension Grpc_Testing_TestServiceProvider {
- public var serviceName: Substring {
- return Grpc_Testing_TestServiceServerMetadata.serviceDescriptor.fullName[...]
- }
- /// Determines, calls and returns the appropriate request handler, depending on the request's method.
- /// Returns nil for methods not handled by this service.
- public func handle(
- method name: Substring,
- context: CallHandlerContext
- ) -> GRPCServerHandlerProtocol? {
- switch name {
- case "EmptyCall":
- return UnaryServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
- interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? [],
- userFunction: self.emptyCall(request:context:)
- )
- case "UnaryCall":
- return UnaryServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? [],
- userFunction: self.unaryCall(request:context:)
- )
- case "CacheableUnaryCall":
- return UnaryServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? [],
- userFunction: self.cacheableUnaryCall(request:context:)
- )
- case "StreamingOutputCall":
- return ServerStreamingServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? [],
- userFunction: self.streamingOutputCall(request:context:)
- )
- case "StreamingInputCall":
- return ClientStreamingServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingInputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingInputCallResponse>(),
- interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? [],
- observerFactory: self.streamingInputCall(context:)
- )
- case "FullDuplexCall":
- return BidirectionalStreamingServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? [],
- observerFactory: self.fullDuplexCall(context:)
- )
- case "HalfDuplexCall":
- return BidirectionalStreamingServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? [],
- observerFactory: self.halfDuplexCall(context:)
- )
- default:
- return nil
- }
- }
- }
- /// A simple service to test the various types of RPCs and experiment with
- /// performance with various types of payload.
- ///
- /// To implement a server, implement an object which conforms to this protocol.
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public protocol Grpc_Testing_TestServiceAsyncProvider: CallHandlerProvider, Sendable {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_TestServiceServerInterceptorFactoryProtocol? { get }
- /// One empty request followed by one empty response.
- func emptyCall(
- request: Grpc_Testing_Empty,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_Empty
- /// One request followed by one response.
- func unaryCall(
- request: Grpc_Testing_SimpleRequest,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_SimpleResponse
- /// One request followed by one response. Response has cache control
- /// headers set such that a caching HTTP proxy (such as GFE) can
- /// satisfy subsequent requests.
- func cacheableUnaryCall(
- request: Grpc_Testing_SimpleRequest,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_SimpleResponse
- /// One request followed by a sequence of responses (streamed download).
- /// The server returns the payload with client desired type and sizes.
- func streamingOutputCall(
- request: Grpc_Testing_StreamingOutputCallRequest,
- responseStream: GRPCAsyncResponseStreamWriter<Grpc_Testing_StreamingOutputCallResponse>,
- context: GRPCAsyncServerCallContext
- ) async throws
- /// A sequence of requests followed by one response (streamed upload).
- /// The server returns the aggregated size of client payload as the result.
- func streamingInputCall(
- requestStream: GRPCAsyncRequestStream<Grpc_Testing_StreamingInputCallRequest>,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_StreamingInputCallResponse
- /// A sequence of requests with each request served by the server immediately.
- /// As one request could lead to multiple responses, this interface
- /// demonstrates the idea of full duplexing.
- func fullDuplexCall(
- requestStream: GRPCAsyncRequestStream<Grpc_Testing_StreamingOutputCallRequest>,
- responseStream: GRPCAsyncResponseStreamWriter<Grpc_Testing_StreamingOutputCallResponse>,
- context: GRPCAsyncServerCallContext
- ) async throws
- /// A sequence of requests followed by a sequence of responses.
- /// The server buffers all the client requests and then serves them in order. A
- /// stream of responses are returned to the client when the server starts with
- /// first request.
- func halfDuplexCall(
- requestStream: GRPCAsyncRequestStream<Grpc_Testing_StreamingOutputCallRequest>,
- responseStream: GRPCAsyncResponseStreamWriter<Grpc_Testing_StreamingOutputCallResponse>,
- context: GRPCAsyncServerCallContext
- ) async throws
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_TestServiceAsyncProvider {
- public static var serviceDescriptor: GRPCServiceDescriptor {
- return Grpc_Testing_TestServiceServerMetadata.serviceDescriptor
- }
- public var serviceName: Substring {
- return Grpc_Testing_TestServiceServerMetadata.serviceDescriptor.fullName[...]
- }
- public var interceptors: Grpc_Testing_TestServiceServerInterceptorFactoryProtocol? {
- return nil
- }
- public func handle(
- method name: Substring,
- context: CallHandlerContext
- ) -> GRPCServerHandlerProtocol? {
- switch name {
- case "EmptyCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
- interceptors: self.interceptors?.makeEmptyCallInterceptors() ?? [],
- wrapping: { try await self.emptyCall(request: $0, context: $1) }
- )
- case "UnaryCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? [],
- wrapping: { try await self.unaryCall(request: $0, context: $1) }
- )
- case "CacheableUnaryCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? [],
- wrapping: { try await self.cacheableUnaryCall(request: $0, context: $1) }
- )
- case "StreamingOutputCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? [],
- wrapping: { try await self.streamingOutputCall(request: $0, responseStream: $1, context: $2) }
- )
- case "StreamingInputCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingInputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingInputCallResponse>(),
- interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? [],
- wrapping: { try await self.streamingInputCall(requestStream: $0, context: $1) }
- )
- case "FullDuplexCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? [],
- wrapping: { try await self.fullDuplexCall(requestStream: $0, responseStream: $1, context: $2) }
- )
- case "HalfDuplexCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? [],
- wrapping: { try await self.halfDuplexCall(requestStream: $0, responseStream: $1, context: $2) }
- )
- default:
- return nil
- }
- }
- }
- public protocol Grpc_Testing_TestServiceServerInterceptorFactoryProtocol: Sendable {
- /// - Returns: Interceptors to use when handling 'emptyCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeEmptyCallInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
- /// - Returns: Interceptors to use when handling 'unaryCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeUnaryCallInterceptors() -> [ServerInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
- /// - Returns: Interceptors to use when handling 'cacheableUnaryCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeCacheableUnaryCallInterceptors() -> [ServerInterceptor<Grpc_Testing_SimpleRequest, Grpc_Testing_SimpleResponse>]
- /// - Returns: Interceptors to use when handling 'streamingOutputCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeStreamingOutputCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
- /// - Returns: Interceptors to use when handling 'streamingInputCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeStreamingInputCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingInputCallRequest, Grpc_Testing_StreamingInputCallResponse>]
- /// - Returns: Interceptors to use when handling 'fullDuplexCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeFullDuplexCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
- /// - Returns: Interceptors to use when handling 'halfDuplexCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeHalfDuplexCallInterceptors() -> [ServerInterceptor<Grpc_Testing_StreamingOutputCallRequest, Grpc_Testing_StreamingOutputCallResponse>]
- /// - Returns: Interceptors to use when handling 'unimplementedCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeUnimplementedCallInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
- }
- public enum Grpc_Testing_TestServiceServerMetadata {
- public static let serviceDescriptor = GRPCServiceDescriptor(
- name: "TestService",
- fullName: "grpc.testing.TestService",
- methods: [
- Grpc_Testing_TestServiceServerMetadata.Methods.emptyCall,
- Grpc_Testing_TestServiceServerMetadata.Methods.unaryCall,
- Grpc_Testing_TestServiceServerMetadata.Methods.cacheableUnaryCall,
- Grpc_Testing_TestServiceServerMetadata.Methods.streamingOutputCall,
- Grpc_Testing_TestServiceServerMetadata.Methods.streamingInputCall,
- Grpc_Testing_TestServiceServerMetadata.Methods.fullDuplexCall,
- Grpc_Testing_TestServiceServerMetadata.Methods.halfDuplexCall,
- Grpc_Testing_TestServiceServerMetadata.Methods.unimplementedCall,
- ]
- )
- public enum Methods {
- public static let emptyCall = GRPCMethodDescriptor(
- name: "EmptyCall",
- path: "/grpc.testing.TestService/EmptyCall",
- type: GRPCCallType.unary
- )
- public static let unaryCall = GRPCMethodDescriptor(
- name: "UnaryCall",
- path: "/grpc.testing.TestService/UnaryCall",
- type: GRPCCallType.unary
- )
- public static let cacheableUnaryCall = GRPCMethodDescriptor(
- name: "CacheableUnaryCall",
- path: "/grpc.testing.TestService/CacheableUnaryCall",
- type: GRPCCallType.unary
- )
- public static let streamingOutputCall = GRPCMethodDescriptor(
- name: "StreamingOutputCall",
- path: "/grpc.testing.TestService/StreamingOutputCall",
- type: GRPCCallType.serverStreaming
- )
- public static let streamingInputCall = GRPCMethodDescriptor(
- name: "StreamingInputCall",
- path: "/grpc.testing.TestService/StreamingInputCall",
- type: GRPCCallType.clientStreaming
- )
- public static let fullDuplexCall = GRPCMethodDescriptor(
- name: "FullDuplexCall",
- path: "/grpc.testing.TestService/FullDuplexCall",
- type: GRPCCallType.bidirectionalStreaming
- )
- public static let halfDuplexCall = GRPCMethodDescriptor(
- name: "HalfDuplexCall",
- path: "/grpc.testing.TestService/HalfDuplexCall",
- type: GRPCCallType.bidirectionalStreaming
- )
- public static let unimplementedCall = GRPCMethodDescriptor(
- name: "UnimplementedCall",
- path: "/grpc.testing.TestService/UnimplementedCall",
- type: GRPCCallType.unary
- )
- }
- }
- /// A simple service NOT implemented at servers so clients can test for
- /// that case.
- ///
- /// To build a server, implement a class that conforms to this protocol.
- public protocol Grpc_Testing_UnimplementedServiceProvider: CallHandlerProvider {
- var interceptors: Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol? { get }
- /// A call that no server should implement
- func unimplementedCall(request: Grpc_Testing_Empty, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_Empty>
- }
- extension Grpc_Testing_UnimplementedServiceProvider {
- public var serviceName: Substring {
- return Grpc_Testing_UnimplementedServiceServerMetadata.serviceDescriptor.fullName[...]
- }
- /// Determines, calls and returns the appropriate request handler, depending on the request's method.
- /// Returns nil for methods not handled by this service.
- public func handle(
- method name: Substring,
- context: CallHandlerContext
- ) -> GRPCServerHandlerProtocol? {
- switch name {
- case "UnimplementedCall":
- return UnaryServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? [],
- userFunction: self.unimplementedCall(request:context:)
- )
- default:
- return nil
- }
- }
- }
- /// A simple service NOT implemented at servers so clients can test for
- /// that case.
- ///
- /// To implement a server, implement an object which conforms to this protocol.
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public protocol Grpc_Testing_UnimplementedServiceAsyncProvider: CallHandlerProvider, Sendable {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol? { get }
- /// A call that no server should implement
- func unimplementedCall(
- request: Grpc_Testing_Empty,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_Empty
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_UnimplementedServiceAsyncProvider {
- public static var serviceDescriptor: GRPCServiceDescriptor {
- return Grpc_Testing_UnimplementedServiceServerMetadata.serviceDescriptor
- }
- public var serviceName: Substring {
- return Grpc_Testing_UnimplementedServiceServerMetadata.serviceDescriptor.fullName[...]
- }
- public var interceptors: Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol? {
- return nil
- }
- public func handle(
- method name: Substring,
- context: CallHandlerContext
- ) -> GRPCServerHandlerProtocol? {
- switch name {
- case "UnimplementedCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
- interceptors: self.interceptors?.makeUnimplementedCallInterceptors() ?? [],
- wrapping: { try await self.unimplementedCall(request: $0, context: $1) }
- )
- default:
- return nil
- }
- }
- }
- public protocol Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol: Sendable {
- /// - Returns: Interceptors to use when handling 'unimplementedCall'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeUnimplementedCallInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_Empty>]
- }
- public enum Grpc_Testing_UnimplementedServiceServerMetadata {
- public static let serviceDescriptor = GRPCServiceDescriptor(
- name: "UnimplementedService",
- fullName: "grpc.testing.UnimplementedService",
- methods: [
- Grpc_Testing_UnimplementedServiceServerMetadata.Methods.unimplementedCall,
- ]
- )
- public enum Methods {
- public static let unimplementedCall = GRPCMethodDescriptor(
- name: "UnimplementedCall",
- path: "/grpc.testing.UnimplementedService/UnimplementedCall",
- type: GRPCCallType.unary
- )
- }
- }
- /// A service used to control reconnect server.
- ///
- /// To build a server, implement a class that conforms to this protocol.
- public protocol Grpc_Testing_ReconnectServiceProvider: CallHandlerProvider {
- var interceptors: Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol? { get }
- func start(request: Grpc_Testing_ReconnectParams, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_Empty>
- func stop(request: Grpc_Testing_Empty, context: StatusOnlyCallContext) -> EventLoopFuture<Grpc_Testing_ReconnectInfo>
- }
- extension Grpc_Testing_ReconnectServiceProvider {
- public var serviceName: Substring {
- return Grpc_Testing_ReconnectServiceServerMetadata.serviceDescriptor.fullName[...]
- }
- /// Determines, calls and returns the appropriate request handler, depending on the request's method.
- /// Returns nil for methods not handled by this service.
- public func handle(
- method name: Substring,
- context: CallHandlerContext
- ) -> GRPCServerHandlerProtocol? {
- switch name {
- case "Start":
- return UnaryServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_ReconnectParams>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
- interceptors: self.interceptors?.makeStartInterceptors() ?? [],
- userFunction: self.start(request:context:)
- )
- case "Stop":
- return UnaryServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_ReconnectInfo>(),
- interceptors: self.interceptors?.makeStopInterceptors() ?? [],
- userFunction: self.stop(request:context:)
- )
- default:
- return nil
- }
- }
- }
- /// A service used to control reconnect server.
- ///
- /// To implement a server, implement an object which conforms to this protocol.
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- public protocol Grpc_Testing_ReconnectServiceAsyncProvider: CallHandlerProvider, Sendable {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol? { get }
- func start(
- request: Grpc_Testing_ReconnectParams,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_Empty
- func stop(
- request: Grpc_Testing_Empty,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_ReconnectInfo
- }
- @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
- extension Grpc_Testing_ReconnectServiceAsyncProvider {
- public static var serviceDescriptor: GRPCServiceDescriptor {
- return Grpc_Testing_ReconnectServiceServerMetadata.serviceDescriptor
- }
- public var serviceName: Substring {
- return Grpc_Testing_ReconnectServiceServerMetadata.serviceDescriptor.fullName[...]
- }
- public var interceptors: Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol? {
- return nil
- }
- public func handle(
- method name: Substring,
- context: CallHandlerContext
- ) -> GRPCServerHandlerProtocol? {
- switch name {
- case "Start":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_ReconnectParams>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_Empty>(),
- interceptors: self.interceptors?.makeStartInterceptors() ?? [],
- wrapping: { try await self.start(request: $0, context: $1) }
- )
- case "Stop":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_ReconnectInfo>(),
- interceptors: self.interceptors?.makeStopInterceptors() ?? [],
- wrapping: { try await self.stop(request: $0, context: $1) }
- )
- default:
- return nil
- }
- }
- }
- public protocol Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol: Sendable {
- /// - Returns: Interceptors to use when handling 'start'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeStartInterceptors() -> [ServerInterceptor<Grpc_Testing_ReconnectParams, Grpc_Testing_Empty>]
- /// - Returns: Interceptors to use when handling 'stop'.
- /// Defaults to calling `self.makeInterceptors()`.
- func makeStopInterceptors() -> [ServerInterceptor<Grpc_Testing_Empty, Grpc_Testing_ReconnectInfo>]
- }
- public enum Grpc_Testing_ReconnectServiceServerMetadata {
- public static let serviceDescriptor = GRPCServiceDescriptor(
- name: "ReconnectService",
- fullName: "grpc.testing.ReconnectService",
- methods: [
- Grpc_Testing_ReconnectServiceServerMetadata.Methods.start,
- Grpc_Testing_ReconnectServiceServerMetadata.Methods.stop,
- ]
- )
- public enum Methods {
- public static let start = GRPCMethodDescriptor(
- name: "Start",
- path: "/grpc.testing.ReconnectService/Start",
- type: GRPCCallType.unary
- )
- public static let stop = GRPCMethodDescriptor(
- name: "Stop",
- path: "/grpc.testing.ReconnectService/Stop",
- type: GRPCCallType.unary
- )
- }
- }
|