Add email-based tailnet discovery to Apple app
This commit is contained in:
parent
baf1408060
commit
1da00ecdf3
12 changed files with 1784 additions and 213 deletions
761
Apple/Core/Client/Generated/burrow.grpc.swift
Normal file
761
Apple/Core/Client/Generated/burrow.grpc.swift
Normal file
|
|
@ -0,0 +1,761 @@
|
|||
//
|
||||
// DO NOT EDIT.
|
||||
// swift-format-ignore-file
|
||||
//
|
||||
// Generated by the protocol buffer compiler.
|
||||
// Source: burrow.proto
|
||||
//
|
||||
import GRPC
|
||||
import NIO
|
||||
import NIOConcurrencyHelpers
|
||||
import SwiftProtobuf
|
||||
|
||||
|
||||
/// Usage: instantiate `Burrow_TunnelClient`, then call methods of this protocol to make API calls.
|
||||
public protocol Burrow_TunnelClientProtocol: GRPCClient {
|
||||
var serviceName: String { get }
|
||||
var interceptors: Burrow_TunnelClientInterceptorFactoryProtocol? { get }
|
||||
|
||||
func tunnelConfiguration(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?,
|
||||
handler: @escaping (Burrow_TunnelConfigurationResponse) -> Void
|
||||
) -> ServerStreamingCall<Burrow_Empty, Burrow_TunnelConfigurationResponse>
|
||||
|
||||
func tunnelStart(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?
|
||||
) -> UnaryCall<Burrow_Empty, Burrow_Empty>
|
||||
|
||||
func tunnelStop(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?
|
||||
) -> UnaryCall<Burrow_Empty, Burrow_Empty>
|
||||
|
||||
func tunnelStatus(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?,
|
||||
handler: @escaping (Burrow_TunnelStatusResponse) -> Void
|
||||
) -> ServerStreamingCall<Burrow_Empty, Burrow_TunnelStatusResponse>
|
||||
}
|
||||
|
||||
extension Burrow_TunnelClientProtocol {
|
||||
public var serviceName: String {
|
||||
return "burrow.Tunnel"
|
||||
}
|
||||
|
||||
/// Server streaming call to TunnelConfiguration
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to TunnelConfiguration.
|
||||
/// - 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 tunnelConfiguration(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil,
|
||||
handler: @escaping (Burrow_TunnelConfigurationResponse) -> Void
|
||||
) -> ServerStreamingCall<Burrow_Empty, Burrow_TunnelConfigurationResponse> {
|
||||
return self.makeServerStreamingCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelConfiguration.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelConfigurationInterceptors() ?? [],
|
||||
handler: handler
|
||||
)
|
||||
}
|
||||
|
||||
/// Unary call to TunnelStart
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to TunnelStart.
|
||||
/// - callOptions: Call options.
|
||||
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
|
||||
public func tunnelStart(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> UnaryCall<Burrow_Empty, Burrow_Empty> {
|
||||
return self.makeUnaryCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStart.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStartInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
/// Unary call to TunnelStop
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to TunnelStop.
|
||||
/// - callOptions: Call options.
|
||||
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
|
||||
public func tunnelStop(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> UnaryCall<Burrow_Empty, Burrow_Empty> {
|
||||
return self.makeUnaryCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStop.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStopInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
/// Server streaming call to TunnelStatus
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to TunnelStatus.
|
||||
/// - 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 tunnelStatus(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil,
|
||||
handler: @escaping (Burrow_TunnelStatusResponse) -> Void
|
||||
) -> ServerStreamingCall<Burrow_Empty, Burrow_TunnelStatusResponse> {
|
||||
return self.makeServerStreamingCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStatus.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStatusInterceptors() ?? [],
|
||||
handler: handler
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, deprecated)
|
||||
extension Burrow_TunnelClient: @unchecked Sendable {}
|
||||
|
||||
@available(*, deprecated, renamed: "Burrow_TunnelNIOClient")
|
||||
public final class Burrow_TunnelClient: Burrow_TunnelClientProtocol {
|
||||
private let lock = Lock()
|
||||
private var _defaultCallOptions: CallOptions
|
||||
private var _interceptors: Burrow_TunnelClientInterceptorFactoryProtocol?
|
||||
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: Burrow_TunnelClientInterceptorFactoryProtocol? {
|
||||
get { self.lock.withLock { return self._interceptors } }
|
||||
set { self.lock.withLockVoid { self._interceptors = newValue } }
|
||||
}
|
||||
|
||||
/// Creates a client for the burrow.Tunnel 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: Burrow_TunnelClientInterceptorFactoryProtocol? = nil
|
||||
) {
|
||||
self.channel = channel
|
||||
self._defaultCallOptions = defaultCallOptions
|
||||
self._interceptors = interceptors
|
||||
}
|
||||
}
|
||||
|
||||
public struct Burrow_TunnelNIOClient: Burrow_TunnelClientProtocol {
|
||||
public var channel: GRPCChannel
|
||||
public var defaultCallOptions: CallOptions
|
||||
public var interceptors: Burrow_TunnelClientInterceptorFactoryProtocol?
|
||||
|
||||
/// Creates a client for the burrow.Tunnel 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: Burrow_TunnelClientInterceptorFactoryProtocol? = nil
|
||||
) {
|
||||
self.channel = channel
|
||||
self.defaultCallOptions = defaultCallOptions
|
||||
self.interceptors = interceptors
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
public protocol Burrow_TunnelAsyncClientProtocol: GRPCClient {
|
||||
static var serviceDescriptor: GRPCServiceDescriptor { get }
|
||||
var interceptors: Burrow_TunnelClientInterceptorFactoryProtocol? { get }
|
||||
|
||||
func makeTunnelConfigurationCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncServerStreamingCall<Burrow_Empty, Burrow_TunnelConfigurationResponse>
|
||||
|
||||
func makeTunnelStartCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncUnaryCall<Burrow_Empty, Burrow_Empty>
|
||||
|
||||
func makeTunnelStopCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncUnaryCall<Burrow_Empty, Burrow_Empty>
|
||||
|
||||
func makeTunnelStatusCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncServerStreamingCall<Burrow_Empty, Burrow_TunnelStatusResponse>
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
extension Burrow_TunnelAsyncClientProtocol {
|
||||
public static var serviceDescriptor: GRPCServiceDescriptor {
|
||||
return Burrow_TunnelClientMetadata.serviceDescriptor
|
||||
}
|
||||
|
||||
public var interceptors: Burrow_TunnelClientInterceptorFactoryProtocol? {
|
||||
return nil
|
||||
}
|
||||
|
||||
public func makeTunnelConfigurationCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncServerStreamingCall<Burrow_Empty, Burrow_TunnelConfigurationResponse> {
|
||||
return self.makeAsyncServerStreamingCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelConfiguration.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelConfigurationInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func makeTunnelStartCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncUnaryCall<Burrow_Empty, Burrow_Empty> {
|
||||
return self.makeAsyncUnaryCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStart.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStartInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func makeTunnelStopCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncUnaryCall<Burrow_Empty, Burrow_Empty> {
|
||||
return self.makeAsyncUnaryCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStop.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStopInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func makeTunnelStatusCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncServerStreamingCall<Burrow_Empty, Burrow_TunnelStatusResponse> {
|
||||
return self.makeAsyncServerStreamingCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStatus.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStatusInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
extension Burrow_TunnelAsyncClientProtocol {
|
||||
public func tunnelConfiguration(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncResponseStream<Burrow_TunnelConfigurationResponse> {
|
||||
return self.performAsyncServerStreamingCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelConfiguration.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelConfigurationInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func tunnelStart(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) async throws -> Burrow_Empty {
|
||||
return try await self.performAsyncUnaryCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStart.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStartInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func tunnelStop(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) async throws -> Burrow_Empty {
|
||||
return try await self.performAsyncUnaryCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStop.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStopInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func tunnelStatus(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncResponseStream<Burrow_TunnelStatusResponse> {
|
||||
return self.performAsyncServerStreamingCall(
|
||||
path: Burrow_TunnelClientMetadata.Methods.tunnelStatus.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeTunnelStatusInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
public struct Burrow_TunnelAsyncClient: Burrow_TunnelAsyncClientProtocol {
|
||||
public var channel: GRPCChannel
|
||||
public var defaultCallOptions: CallOptions
|
||||
public var interceptors: Burrow_TunnelClientInterceptorFactoryProtocol?
|
||||
|
||||
public init(
|
||||
channel: GRPCChannel,
|
||||
defaultCallOptions: CallOptions = CallOptions(),
|
||||
interceptors: Burrow_TunnelClientInterceptorFactoryProtocol? = nil
|
||||
) {
|
||||
self.channel = channel
|
||||
self.defaultCallOptions = defaultCallOptions
|
||||
self.interceptors = interceptors
|
||||
}
|
||||
}
|
||||
|
||||
public protocol Burrow_TunnelClientInterceptorFactoryProtocol: Sendable {
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'tunnelConfiguration'.
|
||||
func makeTunnelConfigurationInterceptors() -> [ClientInterceptor<Burrow_Empty, Burrow_TunnelConfigurationResponse>]
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'tunnelStart'.
|
||||
func makeTunnelStartInterceptors() -> [ClientInterceptor<Burrow_Empty, Burrow_Empty>]
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'tunnelStop'.
|
||||
func makeTunnelStopInterceptors() -> [ClientInterceptor<Burrow_Empty, Burrow_Empty>]
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'tunnelStatus'.
|
||||
func makeTunnelStatusInterceptors() -> [ClientInterceptor<Burrow_Empty, Burrow_TunnelStatusResponse>]
|
||||
}
|
||||
|
||||
public enum Burrow_TunnelClientMetadata {
|
||||
public static let serviceDescriptor = GRPCServiceDescriptor(
|
||||
name: "Tunnel",
|
||||
fullName: "burrow.Tunnel",
|
||||
methods: [
|
||||
Burrow_TunnelClientMetadata.Methods.tunnelConfiguration,
|
||||
Burrow_TunnelClientMetadata.Methods.tunnelStart,
|
||||
Burrow_TunnelClientMetadata.Methods.tunnelStop,
|
||||
Burrow_TunnelClientMetadata.Methods.tunnelStatus,
|
||||
]
|
||||
)
|
||||
|
||||
public enum Methods {
|
||||
public static let tunnelConfiguration = GRPCMethodDescriptor(
|
||||
name: "TunnelConfiguration",
|
||||
path: "/burrow.Tunnel/TunnelConfiguration",
|
||||
type: GRPCCallType.serverStreaming
|
||||
)
|
||||
|
||||
public static let tunnelStart = GRPCMethodDescriptor(
|
||||
name: "TunnelStart",
|
||||
path: "/burrow.Tunnel/TunnelStart",
|
||||
type: GRPCCallType.unary
|
||||
)
|
||||
|
||||
public static let tunnelStop = GRPCMethodDescriptor(
|
||||
name: "TunnelStop",
|
||||
path: "/burrow.Tunnel/TunnelStop",
|
||||
type: GRPCCallType.unary
|
||||
)
|
||||
|
||||
public static let tunnelStatus = GRPCMethodDescriptor(
|
||||
name: "TunnelStatus",
|
||||
path: "/burrow.Tunnel/TunnelStatus",
|
||||
type: GRPCCallType.serverStreaming
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Usage: instantiate `Burrow_NetworksClient`, then call methods of this protocol to make API calls.
|
||||
public protocol Burrow_NetworksClientProtocol: GRPCClient {
|
||||
var serviceName: String { get }
|
||||
var interceptors: Burrow_NetworksClientInterceptorFactoryProtocol? { get }
|
||||
|
||||
func networkAdd(
|
||||
_ request: Burrow_Network,
|
||||
callOptions: CallOptions?
|
||||
) -> UnaryCall<Burrow_Network, Burrow_Empty>
|
||||
|
||||
func networkList(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?,
|
||||
handler: @escaping (Burrow_NetworkListResponse) -> Void
|
||||
) -> ServerStreamingCall<Burrow_Empty, Burrow_NetworkListResponse>
|
||||
|
||||
func networkReorder(
|
||||
_ request: Burrow_NetworkReorderRequest,
|
||||
callOptions: CallOptions?
|
||||
) -> UnaryCall<Burrow_NetworkReorderRequest, Burrow_Empty>
|
||||
|
||||
func networkDelete(
|
||||
_ request: Burrow_NetworkDeleteRequest,
|
||||
callOptions: CallOptions?
|
||||
) -> UnaryCall<Burrow_NetworkDeleteRequest, Burrow_Empty>
|
||||
}
|
||||
|
||||
extension Burrow_NetworksClientProtocol {
|
||||
public var serviceName: String {
|
||||
return "burrow.Networks"
|
||||
}
|
||||
|
||||
/// Unary call to NetworkAdd
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to NetworkAdd.
|
||||
/// - callOptions: Call options.
|
||||
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
|
||||
public func networkAdd(
|
||||
_ request: Burrow_Network,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> UnaryCall<Burrow_Network, Burrow_Empty> {
|
||||
return self.makeUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkAdd.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkAddInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
/// Server streaming call to NetworkList
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to NetworkList.
|
||||
/// - 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 networkList(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil,
|
||||
handler: @escaping (Burrow_NetworkListResponse) -> Void
|
||||
) -> ServerStreamingCall<Burrow_Empty, Burrow_NetworkListResponse> {
|
||||
return self.makeServerStreamingCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkList.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkListInterceptors() ?? [],
|
||||
handler: handler
|
||||
)
|
||||
}
|
||||
|
||||
/// Unary call to NetworkReorder
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to NetworkReorder.
|
||||
/// - callOptions: Call options.
|
||||
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
|
||||
public func networkReorder(
|
||||
_ request: Burrow_NetworkReorderRequest,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> UnaryCall<Burrow_NetworkReorderRequest, Burrow_Empty> {
|
||||
return self.makeUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkReorder.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkReorderInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
/// Unary call to NetworkDelete
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - request: Request to send to NetworkDelete.
|
||||
/// - callOptions: Call options.
|
||||
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
|
||||
public func networkDelete(
|
||||
_ request: Burrow_NetworkDeleteRequest,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> UnaryCall<Burrow_NetworkDeleteRequest, Burrow_Empty> {
|
||||
return self.makeUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkDelete.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkDeleteInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, deprecated)
|
||||
extension Burrow_NetworksClient: @unchecked Sendable {}
|
||||
|
||||
@available(*, deprecated, renamed: "Burrow_NetworksNIOClient")
|
||||
public final class Burrow_NetworksClient: Burrow_NetworksClientProtocol {
|
||||
private let lock = Lock()
|
||||
private var _defaultCallOptions: CallOptions
|
||||
private var _interceptors: Burrow_NetworksClientInterceptorFactoryProtocol?
|
||||
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: Burrow_NetworksClientInterceptorFactoryProtocol? {
|
||||
get { self.lock.withLock { return self._interceptors } }
|
||||
set { self.lock.withLockVoid { self._interceptors = newValue } }
|
||||
}
|
||||
|
||||
/// Creates a client for the burrow.Networks 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: Burrow_NetworksClientInterceptorFactoryProtocol? = nil
|
||||
) {
|
||||
self.channel = channel
|
||||
self._defaultCallOptions = defaultCallOptions
|
||||
self._interceptors = interceptors
|
||||
}
|
||||
}
|
||||
|
||||
public struct Burrow_NetworksNIOClient: Burrow_NetworksClientProtocol {
|
||||
public var channel: GRPCChannel
|
||||
public var defaultCallOptions: CallOptions
|
||||
public var interceptors: Burrow_NetworksClientInterceptorFactoryProtocol?
|
||||
|
||||
/// Creates a client for the burrow.Networks 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: Burrow_NetworksClientInterceptorFactoryProtocol? = nil
|
||||
) {
|
||||
self.channel = channel
|
||||
self.defaultCallOptions = defaultCallOptions
|
||||
self.interceptors = interceptors
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
public protocol Burrow_NetworksAsyncClientProtocol: GRPCClient {
|
||||
static var serviceDescriptor: GRPCServiceDescriptor { get }
|
||||
var interceptors: Burrow_NetworksClientInterceptorFactoryProtocol? { get }
|
||||
|
||||
func makeNetworkAddCall(
|
||||
_ request: Burrow_Network,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncUnaryCall<Burrow_Network, Burrow_Empty>
|
||||
|
||||
func makeNetworkListCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncServerStreamingCall<Burrow_Empty, Burrow_NetworkListResponse>
|
||||
|
||||
func makeNetworkReorderCall(
|
||||
_ request: Burrow_NetworkReorderRequest,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncUnaryCall<Burrow_NetworkReorderRequest, Burrow_Empty>
|
||||
|
||||
func makeNetworkDeleteCall(
|
||||
_ request: Burrow_NetworkDeleteRequest,
|
||||
callOptions: CallOptions?
|
||||
) -> GRPCAsyncUnaryCall<Burrow_NetworkDeleteRequest, Burrow_Empty>
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
extension Burrow_NetworksAsyncClientProtocol {
|
||||
public static var serviceDescriptor: GRPCServiceDescriptor {
|
||||
return Burrow_NetworksClientMetadata.serviceDescriptor
|
||||
}
|
||||
|
||||
public var interceptors: Burrow_NetworksClientInterceptorFactoryProtocol? {
|
||||
return nil
|
||||
}
|
||||
|
||||
public func makeNetworkAddCall(
|
||||
_ request: Burrow_Network,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncUnaryCall<Burrow_Network, Burrow_Empty> {
|
||||
return self.makeAsyncUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkAdd.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkAddInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func makeNetworkListCall(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncServerStreamingCall<Burrow_Empty, Burrow_NetworkListResponse> {
|
||||
return self.makeAsyncServerStreamingCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkList.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkListInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func makeNetworkReorderCall(
|
||||
_ request: Burrow_NetworkReorderRequest,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncUnaryCall<Burrow_NetworkReorderRequest, Burrow_Empty> {
|
||||
return self.makeAsyncUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkReorder.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkReorderInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func makeNetworkDeleteCall(
|
||||
_ request: Burrow_NetworkDeleteRequest,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncUnaryCall<Burrow_NetworkDeleteRequest, Burrow_Empty> {
|
||||
return self.makeAsyncUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkDelete.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkDeleteInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
extension Burrow_NetworksAsyncClientProtocol {
|
||||
public func networkAdd(
|
||||
_ request: Burrow_Network,
|
||||
callOptions: CallOptions? = nil
|
||||
) async throws -> Burrow_Empty {
|
||||
return try await self.performAsyncUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkAdd.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkAddInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func networkList(
|
||||
_ request: Burrow_Empty,
|
||||
callOptions: CallOptions? = nil
|
||||
) -> GRPCAsyncResponseStream<Burrow_NetworkListResponse> {
|
||||
return self.performAsyncServerStreamingCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkList.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkListInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func networkReorder(
|
||||
_ request: Burrow_NetworkReorderRequest,
|
||||
callOptions: CallOptions? = nil
|
||||
) async throws -> Burrow_Empty {
|
||||
return try await self.performAsyncUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkReorder.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkReorderInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
|
||||
public func networkDelete(
|
||||
_ request: Burrow_NetworkDeleteRequest,
|
||||
callOptions: CallOptions? = nil
|
||||
) async throws -> Burrow_Empty {
|
||||
return try await self.performAsyncUnaryCall(
|
||||
path: Burrow_NetworksClientMetadata.Methods.networkDelete.path,
|
||||
request: request,
|
||||
callOptions: callOptions ?? self.defaultCallOptions,
|
||||
interceptors: self.interceptors?.makeNetworkDeleteInterceptors() ?? []
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
|
||||
public struct Burrow_NetworksAsyncClient: Burrow_NetworksAsyncClientProtocol {
|
||||
public var channel: GRPCChannel
|
||||
public var defaultCallOptions: CallOptions
|
||||
public var interceptors: Burrow_NetworksClientInterceptorFactoryProtocol?
|
||||
|
||||
public init(
|
||||
channel: GRPCChannel,
|
||||
defaultCallOptions: CallOptions = CallOptions(),
|
||||
interceptors: Burrow_NetworksClientInterceptorFactoryProtocol? = nil
|
||||
) {
|
||||
self.channel = channel
|
||||
self.defaultCallOptions = defaultCallOptions
|
||||
self.interceptors = interceptors
|
||||
}
|
||||
}
|
||||
|
||||
public protocol Burrow_NetworksClientInterceptorFactoryProtocol: Sendable {
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'networkAdd'.
|
||||
func makeNetworkAddInterceptors() -> [ClientInterceptor<Burrow_Network, Burrow_Empty>]
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'networkList'.
|
||||
func makeNetworkListInterceptors() -> [ClientInterceptor<Burrow_Empty, Burrow_NetworkListResponse>]
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'networkReorder'.
|
||||
func makeNetworkReorderInterceptors() -> [ClientInterceptor<Burrow_NetworkReorderRequest, Burrow_Empty>]
|
||||
|
||||
/// - Returns: Interceptors to use when invoking 'networkDelete'.
|
||||
func makeNetworkDeleteInterceptors() -> [ClientInterceptor<Burrow_NetworkDeleteRequest, Burrow_Empty>]
|
||||
}
|
||||
|
||||
public enum Burrow_NetworksClientMetadata {
|
||||
public static let serviceDescriptor = GRPCServiceDescriptor(
|
||||
name: "Networks",
|
||||
fullName: "burrow.Networks",
|
||||
methods: [
|
||||
Burrow_NetworksClientMetadata.Methods.networkAdd,
|
||||
Burrow_NetworksClientMetadata.Methods.networkList,
|
||||
Burrow_NetworksClientMetadata.Methods.networkReorder,
|
||||
Burrow_NetworksClientMetadata.Methods.networkDelete,
|
||||
]
|
||||
)
|
||||
|
||||
public enum Methods {
|
||||
public static let networkAdd = GRPCMethodDescriptor(
|
||||
name: "NetworkAdd",
|
||||
path: "/burrow.Networks/NetworkAdd",
|
||||
type: GRPCCallType.unary
|
||||
)
|
||||
|
||||
public static let networkList = GRPCMethodDescriptor(
|
||||
name: "NetworkList",
|
||||
path: "/burrow.Networks/NetworkList",
|
||||
type: GRPCCallType.serverStreaming
|
||||
)
|
||||
|
||||
public static let networkReorder = GRPCMethodDescriptor(
|
||||
name: "NetworkReorder",
|
||||
path: "/burrow.Networks/NetworkReorder",
|
||||
type: GRPCCallType.unary
|
||||
)
|
||||
|
||||
public static let networkDelete = GRPCMethodDescriptor(
|
||||
name: "NetworkDelete",
|
||||
path: "/burrow.Networks/NetworkDelete",
|
||||
type: GRPCCallType.unary
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue