| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669 |
- //
- // 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 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() ?? []
- )
- }
- }
- public final class Grpc_Testing_TestServiceClient: Grpc_Testing_TestServiceClientProtocol {
- public let 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
- }
- }
- #if compiler(>=5.5.2) && canImport(_Concurrency)
- /// 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, 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, 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, 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
- }
- }
- #endif // compiler(>=5.5.2) && canImport(_Concurrency)
- public protocol Grpc_Testing_TestServiceClientInterceptorFactoryProtocol {
- /// - 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() ?? []
- )
- }
- }
- public final class Grpc_Testing_UnimplementedServiceClient: Grpc_Testing_UnimplementedServiceClientProtocol {
- public let 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
- }
- }
- #if compiler(>=5.5.2) && canImport(_Concurrency)
- /// 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
- }
- }
- #endif // compiler(>=5.5.2) && canImport(_Concurrency)
- public protocol Grpc_Testing_UnimplementedServiceClientInterceptorFactoryProtocol {
- /// - 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() ?? []
- )
- }
- }
- public final class Grpc_Testing_ReconnectServiceClient: Grpc_Testing_ReconnectServiceClientProtocol {
- public let 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
- }
- }
- #if compiler(>=5.5.2) && canImport(_Concurrency)
- /// 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
- }
- }
- #endif // compiler(>=5.5.2) && canImport(_Concurrency)
- public protocol Grpc_Testing_ReconnectServiceClientInterceptorFactoryProtocol {
- /// - 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
- }
- }
- }
- #if compiler(>=5.5.2) && canImport(_Concurrency)
- /// 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 {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_TestServiceServerInterceptorFactoryProtocol? { get }
- /// One empty request followed by one empty response.
- @Sendable func emptyCall(
- request: Grpc_Testing_Empty,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_Empty
- /// One request followed by one response.
- @Sendable 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.
- @Sendable 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.
- @Sendable 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.
- @Sendable 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.
- @Sendable 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.
- @Sendable 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: self.emptyCall(request:context:)
- )
- case "UnaryCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- interceptors: self.interceptors?.makeUnaryCallInterceptors() ?? [],
- wrapping: self.unaryCall(request:context:)
- )
- case "CacheableUnaryCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_SimpleRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_SimpleResponse>(),
- interceptors: self.interceptors?.makeCacheableUnaryCallInterceptors() ?? [],
- wrapping: self.cacheableUnaryCall(request:context:)
- )
- case "StreamingOutputCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeStreamingOutputCallInterceptors() ?? [],
- wrapping: self.streamingOutputCall(request:responseStream:context:)
- )
- case "StreamingInputCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingInputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingInputCallResponse>(),
- interceptors: self.interceptors?.makeStreamingInputCallInterceptors() ?? [],
- wrapping: self.streamingInputCall(requestStream:context:)
- )
- case "FullDuplexCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeFullDuplexCallInterceptors() ?? [],
- wrapping: self.fullDuplexCall(requestStream:responseStream:context:)
- )
- case "HalfDuplexCall":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_StreamingOutputCallRequest>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_StreamingOutputCallResponse>(),
- interceptors: self.interceptors?.makeHalfDuplexCallInterceptors() ?? [],
- wrapping: self.halfDuplexCall(requestStream:responseStream:context:)
- )
- default:
- return nil
- }
- }
- }
- #endif // compiler(>=5.5.2) && canImport(_Concurrency)
- public protocol Grpc_Testing_TestServiceServerInterceptorFactoryProtocol {
- /// - 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
- }
- }
- }
- #if compiler(>=5.5.2) && canImport(_Concurrency)
- /// 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 {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol? { get }
- /// A call that no server should implement
- @Sendable 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: self.unimplementedCall(request:context:)
- )
- default:
- return nil
- }
- }
- }
- #endif // compiler(>=5.5.2) && canImport(_Concurrency)
- public protocol Grpc_Testing_UnimplementedServiceServerInterceptorFactoryProtocol {
- /// - 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
- }
- }
- }
- #if compiler(>=5.5.2) && canImport(_Concurrency)
- /// 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 {
- static var serviceDescriptor: GRPCServiceDescriptor { get }
- var interceptors: Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol? { get }
- @Sendable func start(
- request: Grpc_Testing_ReconnectParams,
- context: GRPCAsyncServerCallContext
- ) async throws -> Grpc_Testing_Empty
- @Sendable 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: self.start(request:context:)
- )
- case "Stop":
- return GRPCAsyncServerHandler(
- context: context,
- requestDeserializer: ProtobufDeserializer<Grpc_Testing_Empty>(),
- responseSerializer: ProtobufSerializer<Grpc_Testing_ReconnectInfo>(),
- interceptors: self.interceptors?.makeStopInterceptors() ?? [],
- wrapping: self.stop(request:context:)
- )
- default:
- return nil
- }
- }
- }
- #endif // compiler(>=5.5.2) && canImport(_Concurrency)
- public protocol Grpc_Testing_ReconnectServiceServerInterceptorFactoryProtocol {
- /// - 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
- )
- }
- }
|