blob: 90887302e95c9deb80143ae8e31db55ca515e638 [file] [log] [blame]
//
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the protocol buffer compiler.
// Source: org/apache/beam/model/job_management/v1/beam_expansion_api.proto
//
//
// Copyright 2018, gRPC Authors All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import GRPC
import NIO
import NIOConcurrencyHelpers
import SwiftProtobuf
/// Job Service for constructing pipelines
///
/// Usage: instantiate `Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClient`, then call methods of this protocol to make API calls.
internal protocol Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientProtocol: GRPCClient {
var serviceName: String { get }
var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol? { get }
func expand(
_ request: Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest,
callOptions: CallOptions?
) -> UnaryCall<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest, Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse>
func discoverSchemaTransform(
_ request: Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest,
callOptions: CallOptions?
) -> UnaryCall<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest, Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse>
}
extension Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientProtocol {
internal var serviceName: String {
return "org.apache.beam.model.expansion.v1.ExpansionService"
}
/// Unary call to Expand
///
/// - Parameters:
/// - request: Request to send to Expand.
/// - callOptions: Call options.
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
internal func expand(
_ request: Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest,
callOptions: CallOptions? = nil
) -> UnaryCall<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest, Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse> {
return self.makeUnaryCall(
path: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.expand.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeExpandInterceptors() ?? []
)
}
///A RPC to discover already registered SchemaTransformProviders.
/// See https://s.apache.org/easy-multi-language for more details.
///
/// - Parameters:
/// - request: Request to send to DiscoverSchemaTransform.
/// - callOptions: Call options.
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
internal func discoverSchemaTransform(
_ request: Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest,
callOptions: CallOptions? = nil
) -> UnaryCall<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest, Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse> {
return self.makeUnaryCall(
path: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.discoverSchemaTransform.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeDiscoverSchemaTransformInterceptors() ?? []
)
}
}
@available(*, deprecated)
extension Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClient: @unchecked Sendable {}
@available(*, deprecated, renamed: "Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceNIOClient")
internal final class Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClient: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientProtocol {
private let lock = Lock()
private var _defaultCallOptions: CallOptions
private var _interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol?
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: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol? {
get { self.lock.withLock { return self._interceptors } }
set { self.lock.withLockVoid { self._interceptors = newValue } }
}
/// Creates a client for the org.apache.beam.model.expansion.v1.ExpansionService 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: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self._defaultCallOptions = defaultCallOptions
self._interceptors = interceptors
}
}
internal struct Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceNIOClient: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol?
/// Creates a client for the org.apache.beam.model.expansion.v1.ExpansionService 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: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
/// Job Service for constructing pipelines
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol? { get }
func makeExpandCall(
_ request: Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest,
callOptions: CallOptions?
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest, Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse>
func makeDiscoverSchemaTransformCall(
_ request: Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest,
callOptions: CallOptions?
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest, Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse>
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceAsyncClientProtocol {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.serviceDescriptor
}
internal var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol? {
return nil
}
internal func makeExpandCall(
_ request: Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest,
callOptions: CallOptions? = nil
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest, Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse> {
return self.makeAsyncUnaryCall(
path: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.expand.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeExpandInterceptors() ?? []
)
}
internal func makeDiscoverSchemaTransformCall(
_ request: Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest,
callOptions: CallOptions? = nil
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest, Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse> {
return self.makeAsyncUnaryCall(
path: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.discoverSchemaTransform.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeDiscoverSchemaTransformInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceAsyncClientProtocol {
internal func expand(
_ request: Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest,
callOptions: CallOptions? = nil
) async throws -> Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse {
return try await self.performAsyncUnaryCall(
path: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.expand.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeExpandInterceptors() ?? []
)
}
internal func discoverSchemaTransform(
_ request: Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest,
callOptions: CallOptions? = nil
) async throws -> Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse {
return try await self.performAsyncUnaryCall(
path: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.discoverSchemaTransform.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeDiscoverSchemaTransformInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal struct Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceAsyncClient: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceAsyncClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol?
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
internal protocol Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'expand'.
func makeExpandInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest, Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse>]
/// - Returns: Interceptors to use when invoking 'discoverSchemaTransform'.
func makeDiscoverSchemaTransformInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest, Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse>]
}
internal enum Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "ExpansionService",
fullName: "org.apache.beam.model.expansion.v1.ExpansionService",
methods: [
Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.expand,
Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceClientMetadata.Methods.discoverSchemaTransform,
]
)
internal enum Methods {
internal static let expand = GRPCMethodDescriptor(
name: "Expand",
path: "/org.apache.beam.model.expansion.v1.ExpansionService/Expand",
type: GRPCCallType.unary
)
internal static let discoverSchemaTransform = GRPCMethodDescriptor(
name: "DiscoverSchemaTransform",
path: "/org.apache.beam.model.expansion.v1.ExpansionService/DiscoverSchemaTransform",
type: GRPCCallType.unary
)
}
}
/// Job Service for constructing pipelines
///
/// To build a server, implement a class that conforms to this protocol.
internal protocol Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceProvider: CallHandlerProvider {
var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerInterceptorFactoryProtocol? { get }
func expand(request: Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse>
///A RPC to discover already registered SchemaTransformProviders.
/// See https://s.apache.org/easy-multi-language for more details.
func discoverSchemaTransform(request: Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse>
}
extension Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceProvider {
internal var serviceName: Substring {
return Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerMetadata.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.
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Expand":
return UnaryServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse>(),
interceptors: self.interceptors?.makeExpandInterceptors() ?? [],
userFunction: self.expand(request:context:)
)
case "DiscoverSchemaTransform":
return UnaryServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse>(),
interceptors: self.interceptors?.makeDiscoverSchemaTransformInterceptors() ?? [],
userFunction: self.discoverSchemaTransform(request:context:)
)
default:
return nil
}
}
}
/// Job Service for constructing pipelines
///
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerInterceptorFactoryProtocol? { get }
func expand(
request: Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest,
context: GRPCAsyncServerCallContext
) async throws -> Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse
///A RPC to discover already registered SchemaTransformProviders.
/// See https://s.apache.org/easy-multi-language for more details.
func discoverSchemaTransform(
request: Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest,
context: GRPCAsyncServerCallContext
) async throws -> Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceAsyncProvider {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerMetadata.serviceDescriptor
}
internal var serviceName: Substring {
return Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerMetadata.serviceDescriptor.fullName[...]
}
internal var interceptors: Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerInterceptorFactoryProtocol? {
return nil
}
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Expand":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse>(),
interceptors: self.interceptors?.makeExpandInterceptors() ?? [],
wrapping: { try await self.expand(request: $0, context: $1) }
)
case "DiscoverSchemaTransform":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse>(),
interceptors: self.interceptors?.makeDiscoverSchemaTransformInterceptors() ?? [],
wrapping: { try await self.discoverSchemaTransform(request: $0, context: $1) }
)
default:
return nil
}
}
}
internal protocol Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'expand'.
/// Defaults to calling `self.makeInterceptors()`.
func makeExpandInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_Expansion_V1_ExpansionRequest, Org_Apache_Beam_Model_Expansion_V1_ExpansionResponse>]
/// - Returns: Interceptors to use when handling 'discoverSchemaTransform'.
/// Defaults to calling `self.makeInterceptors()`.
func makeDiscoverSchemaTransformInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformRequest, Org_Apache_Beam_Model_Expansion_V1_DiscoverSchemaTransformResponse>]
}
internal enum Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "ExpansionService",
fullName: "org.apache.beam.model.expansion.v1.ExpansionService",
methods: [
Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerMetadata.Methods.expand,
Org_Apache_Beam_Model_Expansion_V1_ExpansionServiceServerMetadata.Methods.discoverSchemaTransform,
]
)
internal enum Methods {
internal static let expand = GRPCMethodDescriptor(
name: "Expand",
path: "/org.apache.beam.model.expansion.v1.ExpansionService/Expand",
type: GRPCCallType.unary
)
internal static let discoverSchemaTransform = GRPCMethodDescriptor(
name: "DiscoverSchemaTransform",
path: "/org.apache.beam.model.expansion.v1.ExpansionService/DiscoverSchemaTransform",
type: GRPCCallType.unary
)
}
}