// // DO NOT EDIT. // swift-format-ignore-file // // Generated by the protocol buffer compiler. // Source: reflection.proto // import GRPC import NIO import NIOConcurrencyHelpers import SwiftProtobuf /// Usage: instantiate `Grpc_Reflection_V1_ServerReflectionClient`, then call methods of this protocol to make API calls. internal protocol Grpc_Reflection_V1_ServerReflectionClientProtocol: GRPCClient { var serviceName: String { get } var interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? { get } func serverReflectionInfo( callOptions: CallOptions?, handler: @escaping (Grpc_Reflection_V1_ServerReflectionResponse) -> Void ) -> BidirectionalStreamingCall } extension Grpc_Reflection_V1_ServerReflectionClientProtocol { internal var serviceName: String { return "grpc.reflection.v1.ServerReflection" } /// The reflection service is structured as a bidirectional stream, ensuring /// all related requests go to a single server. /// /// 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. internal func serverReflectionInfo( callOptions: CallOptions? = nil, handler: @escaping (Grpc_Reflection_V1_ServerReflectionResponse) -> Void ) -> BidirectionalStreamingCall { return self.makeBidirectionalStreamingCall( path: Grpc_Reflection_V1_ServerReflectionClientMetadata.Methods.serverReflectionInfo.path, callOptions: callOptions ?? self.defaultCallOptions, interceptors: self.interceptors?.makeServerReflectionInfoInterceptors() ?? [], handler: handler ) } } @available(*, deprecated) extension Grpc_Reflection_V1_ServerReflectionClient: @unchecked Sendable {} @available(*, deprecated, renamed: "Grpc_Reflection_V1_ServerReflectionNIOClient") internal final class Grpc_Reflection_V1_ServerReflectionClient: Grpc_Reflection_V1_ServerReflectionClientProtocol { private let lock = Lock() private var _defaultCallOptions: CallOptions private var _interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? internal let channel: GRPCChannel internal var defaultCallOptions: CallOptions { get { self.lock.withLock { return self._defaultCallOptions } } set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } } internal var interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? { get { self.lock.withLock { return self._interceptors } } set { self.lock.withLockVoid { self._interceptors = newValue } } } /// Creates a client for the grpc.reflection.v1.ServerReflection 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. internal init( channel: GRPCChannel, defaultCallOptions: CallOptions = CallOptions(), interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? = nil ) { self.channel = channel self._defaultCallOptions = defaultCallOptions self._interceptors = interceptors } } internal struct Grpc_Reflection_V1_ServerReflectionNIOClient: Grpc_Reflection_V1_ServerReflectionClientProtocol { internal var channel: GRPCChannel internal var defaultCallOptions: CallOptions internal var interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? /// Creates a client for the grpc.reflection.v1.ServerReflection 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. internal init( channel: GRPCChannel, defaultCallOptions: CallOptions = CallOptions(), interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? = nil ) { self.channel = channel self.defaultCallOptions = defaultCallOptions self.interceptors = interceptors } } @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) internal protocol Grpc_Reflection_V1_ServerReflectionAsyncClientProtocol: GRPCClient { static var serviceDescriptor: GRPCServiceDescriptor { get } var interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? { get } func makeServerReflectionInfoCall( callOptions: CallOptions? ) -> GRPCAsyncBidirectionalStreamingCall } @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension Grpc_Reflection_V1_ServerReflectionAsyncClientProtocol { internal static var serviceDescriptor: GRPCServiceDescriptor { return Grpc_Reflection_V1_ServerReflectionClientMetadata.serviceDescriptor } internal var interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? { return nil } internal func makeServerReflectionInfoCall( callOptions: CallOptions? = nil ) -> GRPCAsyncBidirectionalStreamingCall { return self.makeAsyncBidirectionalStreamingCall( path: Grpc_Reflection_V1_ServerReflectionClientMetadata.Methods.serverReflectionInfo.path, callOptions: callOptions ?? self.defaultCallOptions, interceptors: self.interceptors?.makeServerReflectionInfoInterceptors() ?? [] ) } } @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) extension Grpc_Reflection_V1_ServerReflectionAsyncClientProtocol { internal func serverReflectionInfo( _ requests: RequestStream, callOptions: CallOptions? = nil ) -> GRPCAsyncResponseStream where RequestStream: Sequence, RequestStream.Element == Grpc_Reflection_V1_ServerReflectionRequest { return self.performAsyncBidirectionalStreamingCall( path: Grpc_Reflection_V1_ServerReflectionClientMetadata.Methods.serverReflectionInfo.path, requests: requests, callOptions: callOptions ?? self.defaultCallOptions, interceptors: self.interceptors?.makeServerReflectionInfoInterceptors() ?? [] ) } internal func serverReflectionInfo( _ requests: RequestStream, callOptions: CallOptions? = nil ) -> GRPCAsyncResponseStream where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Grpc_Reflection_V1_ServerReflectionRequest { return self.performAsyncBidirectionalStreamingCall( path: Grpc_Reflection_V1_ServerReflectionClientMetadata.Methods.serverReflectionInfo.path, requests: requests, callOptions: callOptions ?? self.defaultCallOptions, interceptors: self.interceptors?.makeServerReflectionInfoInterceptors() ?? [] ) } } @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) internal struct Grpc_Reflection_V1_ServerReflectionAsyncClient: Grpc_Reflection_V1_ServerReflectionAsyncClientProtocol { internal var channel: GRPCChannel internal var defaultCallOptions: CallOptions internal var interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? internal init( channel: GRPCChannel, defaultCallOptions: CallOptions = CallOptions(), interceptors: Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol? = nil ) { self.channel = channel self.defaultCallOptions = defaultCallOptions self.interceptors = interceptors } } internal protocol Grpc_Reflection_V1_ServerReflectionClientInterceptorFactoryProtocol: Sendable { /// - Returns: Interceptors to use when invoking 'serverReflectionInfo'. func makeServerReflectionInfoInterceptors() -> [ClientInterceptor] } internal enum Grpc_Reflection_V1_ServerReflectionClientMetadata { internal static let serviceDescriptor = GRPCServiceDescriptor( name: "ServerReflection", fullName: "grpc.reflection.v1.ServerReflection", methods: [ Grpc_Reflection_V1_ServerReflectionClientMetadata.Methods.serverReflectionInfo, ] ) internal enum Methods { internal static let serverReflectionInfo = GRPCMethodDescriptor( name: "ServerReflectionInfo", path: "/grpc.reflection.v1.ServerReflection/ServerReflectionInfo", type: GRPCCallType.bidirectionalStreaming ) } }