| // |
| // DO NOT EDIT. |
| // swift-format-ignore-file |
| // |
| // Generated by the protocol buffer compiler. |
| // Source: org/apache/beam/model/job_management/v1/beam_job_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 running RunnerAPI pipelines |
| /// |
| /// Usage: instantiate `Org_Apache_Beam_Model_JobManagement_V1_JobServiceClient`, then call methods of this protocol to make API calls. |
| internal protocol Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientProtocol: GRPCClient { |
| var serviceName: String { get } |
| var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? { get } |
| |
| func prepare( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse> |
| |
| func run( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse> |
| |
| func getJobs( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse> |
| |
| func getState( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> |
| |
| func getPipeline( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse> |
| |
| func cancel( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse> |
| |
| func getStateStream( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions?, |
| handler: @escaping (Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent) -> Void |
| ) -> ServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> |
| |
| func getMessageStream( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, |
| callOptions: CallOptions?, |
| handler: @escaping (Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse) -> Void |
| ) -> ServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse> |
| |
| func getJobMetrics( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse> |
| |
| func describePipelineOptions( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, |
| callOptions: CallOptions? |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse> |
| } |
| |
| extension Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientProtocol { |
| internal var serviceName: String { |
| return "org.apache.beam.model.job_management.v1.JobService" |
| } |
| |
| /// Prepare a job for execution. The job will not be executed until a call is made to run with the |
| /// returned preparationId. |
| /// |
| /// - Parameters: |
| /// - request: Request to send to Prepare. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func prepare( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.prepare.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makePrepareInterceptors() ?? [] |
| ) |
| } |
| |
| /// Submit the job for execution |
| /// |
| /// - Parameters: |
| /// - request: Request to send to Run. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func run( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.run.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeRunInterceptors() ?? [] |
| ) |
| } |
| |
| /// Get a list of all invoked jobs |
| /// |
| /// - Parameters: |
| /// - request: Request to send to GetJobs. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func getJobs( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobs.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetJobsInterceptors() ?? [] |
| ) |
| } |
| |
| /// Get the current state of the job |
| /// |
| /// - Parameters: |
| /// - request: Request to send to GetState. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func getState( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getState.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetStateInterceptors() ?? [] |
| ) |
| } |
| |
| /// Get the job's pipeline |
| /// |
| /// - Parameters: |
| /// - request: Request to send to GetPipeline. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func getPipeline( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getPipeline.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetPipelineInterceptors() ?? [] |
| ) |
| } |
| |
| /// Cancel the job |
| /// |
| /// - Parameters: |
| /// - request: Request to send to Cancel. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func cancel( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.cancel.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeCancelInterceptors() ?? [] |
| ) |
| } |
| |
| /// Subscribe to a stream of state changes of the job, will immediately return the current state of the job as the first response. |
| /// |
| /// - Parameters: |
| /// - request: Request to send to GetStateStream. |
| /// - 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. |
| internal func getStateStream( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? = nil, |
| handler: @escaping (Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent) -> Void |
| ) -> ServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> { |
| return self.makeServerStreamingCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getStateStream.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetStateStreamInterceptors() ?? [], |
| handler: handler |
| ) |
| } |
| |
| /// Subscribe to a stream of state changes and messages from the job |
| /// |
| /// - Parameters: |
| /// - request: Request to send to GetMessageStream. |
| /// - 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. |
| internal func getMessageStream( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, |
| callOptions: CallOptions? = nil, |
| handler: @escaping (Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse) -> Void |
| ) -> ServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse> { |
| return self.makeServerStreamingCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getMessageStream.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetMessageStreamInterceptors() ?? [], |
| handler: handler |
| ) |
| } |
| |
| /// Fetch metrics for a given job |
| /// |
| /// - Parameters: |
| /// - request: Request to send to GetJobMetrics. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func getJobMetrics( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobMetrics.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetJobMetricsInterceptors() ?? [] |
| ) |
| } |
| |
| /// Get the supported pipeline options of the runner |
| /// |
| /// - Parameters: |
| /// - request: Request to send to DescribePipelineOptions. |
| /// - callOptions: Call options. |
| /// - Returns: A `UnaryCall` with futures for the metadata, status and response. |
| internal func describePipelineOptions( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, |
| callOptions: CallOptions? = nil |
| ) -> UnaryCall<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse> { |
| return self.makeUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.describePipelineOptions.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeDescribePipelineOptionsInterceptors() ?? [] |
| ) |
| } |
| } |
| |
| @available(*, deprecated) |
| extension Org_Apache_Beam_Model_JobManagement_V1_JobServiceClient: @unchecked Sendable {} |
| |
| @available(*, deprecated, renamed: "Org_Apache_Beam_Model_JobManagement_V1_JobServiceNIOClient") |
| internal final class Org_Apache_Beam_Model_JobManagement_V1_JobServiceClient: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientProtocol { |
| private let lock = Lock() |
| private var _defaultCallOptions: CallOptions |
| private var _interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? |
| 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_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? { |
| get { self.lock.withLock { return self._interceptors } } |
| set { self.lock.withLockVoid { self._interceptors = newValue } } |
| } |
| |
| /// Creates a client for the org.apache.beam.model.job_management.v1.JobService 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_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? = nil |
| ) { |
| self.channel = channel |
| self._defaultCallOptions = defaultCallOptions |
| self._interceptors = interceptors |
| } |
| } |
| |
| internal struct Org_Apache_Beam_Model_JobManagement_V1_JobServiceNIOClient: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientProtocol { |
| internal var channel: GRPCChannel |
| internal var defaultCallOptions: CallOptions |
| internal var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? |
| |
| /// Creates a client for the org.apache.beam.model.job_management.v1.JobService 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_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? = nil |
| ) { |
| self.channel = channel |
| self.defaultCallOptions = defaultCallOptions |
| self.interceptors = interceptors |
| } |
| } |
| |
| /// Job Service for running RunnerAPI pipelines |
| @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) |
| internal protocol Org_Apache_Beam_Model_JobManagement_V1_JobServiceAsyncClientProtocol: GRPCClient { |
| static var serviceDescriptor: GRPCServiceDescriptor { get } |
| var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? { get } |
| |
| func makePrepareCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse> |
| |
| func makeRunCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse> |
| |
| func makeGetJobsCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse> |
| |
| func makeGetStateCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> |
| |
| func makeGetPipelineCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse> |
| |
| func makeCancelCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse> |
| |
| func makeGetStateStreamCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> |
| |
| func makeGetMessageStreamCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse> |
| |
| func makeGetJobMetricsCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse> |
| |
| func makeDescribePipelineOptionsCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, |
| callOptions: CallOptions? |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse> |
| } |
| |
| @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) |
| extension Org_Apache_Beam_Model_JobManagement_V1_JobServiceAsyncClientProtocol { |
| internal static var serviceDescriptor: GRPCServiceDescriptor { |
| return Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.serviceDescriptor |
| } |
| |
| internal var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? { |
| return nil |
| } |
| |
| internal func makePrepareCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.prepare.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makePrepareInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeRunCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.run.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeRunInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeGetJobsCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobs.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetJobsInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeGetStateCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getState.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetStateInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeGetPipelineCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getPipeline.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetPipelineInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeCancelCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.cancel.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeCancelInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeGetStateStreamCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> { |
| return self.makeAsyncServerStreamingCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getStateStream.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetStateStreamInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeGetMessageStreamCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncServerStreamingCall<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse> { |
| return self.makeAsyncServerStreamingCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getMessageStream.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetMessageStreamInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeGetJobMetricsCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobMetrics.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetJobMetricsInterceptors() ?? [] |
| ) |
| } |
| |
| internal func makeDescribePipelineOptionsCall( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse> { |
| return self.makeAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.describePipelineOptions.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeDescribePipelineOptionsInterceptors() ?? [] |
| ) |
| } |
| } |
| |
| @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) |
| extension Org_Apache_Beam_Model_JobManagement_V1_JobServiceAsyncClientProtocol { |
| internal func prepare( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.prepare.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makePrepareInterceptors() ?? [] |
| ) |
| } |
| |
| internal func run( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.run.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeRunInterceptors() ?? [] |
| ) |
| } |
| |
| internal func getJobs( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobs.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetJobsInterceptors() ?? [] |
| ) |
| } |
| |
| internal func getState( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getState.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetStateInterceptors() ?? [] |
| ) |
| } |
| |
| internal func getPipeline( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getPipeline.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetPipelineInterceptors() ?? [] |
| ) |
| } |
| |
| internal func cancel( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.cancel.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeCancelInterceptors() ?? [] |
| ) |
| } |
| |
| internal func getStateStream( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> { |
| return self.performAsyncServerStreamingCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getStateStream.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetStateStreamInterceptors() ?? [] |
| ) |
| } |
| |
| internal func getMessageStream( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, |
| callOptions: CallOptions? = nil |
| ) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse> { |
| return self.performAsyncServerStreamingCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getMessageStream.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetMessageStreamInterceptors() ?? [] |
| ) |
| } |
| |
| internal func getJobMetrics( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobMetrics.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeGetJobMetricsInterceptors() ?? [] |
| ) |
| } |
| |
| internal func describePipelineOptions( |
| _ request: Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, |
| callOptions: CallOptions? = nil |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse { |
| return try await self.performAsyncUnaryCall( |
| path: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.describePipelineOptions.path, |
| request: request, |
| callOptions: callOptions ?? self.defaultCallOptions, |
| interceptors: self.interceptors?.makeDescribePipelineOptionsInterceptors() ?? [] |
| ) |
| } |
| } |
| |
| @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) |
| internal struct Org_Apache_Beam_Model_JobManagement_V1_JobServiceAsyncClient: Org_Apache_Beam_Model_JobManagement_V1_JobServiceAsyncClientProtocol { |
| internal var channel: GRPCChannel |
| internal var defaultCallOptions: CallOptions |
| internal var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? |
| |
| internal init( |
| channel: GRPCChannel, |
| defaultCallOptions: CallOptions = CallOptions(), |
| interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol? = nil |
| ) { |
| self.channel = channel |
| self.defaultCallOptions = defaultCallOptions |
| self.interceptors = interceptors |
| } |
| } |
| |
| internal protocol Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientInterceptorFactoryProtocol: Sendable { |
| |
| /// - Returns: Interceptors to use when invoking 'prepare'. |
| func makePrepareInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse>] |
| |
| /// - Returns: Interceptors to use when invoking 'run'. |
| func makeRunInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse>] |
| |
| /// - Returns: Interceptors to use when invoking 'getJobs'. |
| func makeGetJobsInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse>] |
| |
| /// - Returns: Interceptors to use when invoking 'getState'. |
| func makeGetStateInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>] |
| |
| /// - Returns: Interceptors to use when invoking 'getPipeline'. |
| func makeGetPipelineInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse>] |
| |
| /// - Returns: Interceptors to use when invoking 'cancel'. |
| func makeCancelInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse>] |
| |
| /// - Returns: Interceptors to use when invoking 'getStateStream'. |
| func makeGetStateStreamInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>] |
| |
| /// - Returns: Interceptors to use when invoking 'getMessageStream'. |
| func makeGetMessageStreamInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse>] |
| |
| /// - Returns: Interceptors to use when invoking 'getJobMetrics'. |
| func makeGetJobMetricsInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse>] |
| |
| /// - Returns: Interceptors to use when invoking 'describePipelineOptions'. |
| func makeDescribePipelineOptionsInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse>] |
| } |
| |
| internal enum Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata { |
| internal static let serviceDescriptor = GRPCServiceDescriptor( |
| name: "JobService", |
| fullName: "org.apache.beam.model.job_management.v1.JobService", |
| methods: [ |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.prepare, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.run, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobs, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getState, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getPipeline, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.cancel, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getStateStream, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getMessageStream, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.getJobMetrics, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceClientMetadata.Methods.describePipelineOptions, |
| ] |
| ) |
| |
| internal enum Methods { |
| internal static let prepare = GRPCMethodDescriptor( |
| name: "Prepare", |
| path: "/org.apache.beam.model.job_management.v1.JobService/Prepare", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let run = GRPCMethodDescriptor( |
| name: "Run", |
| path: "/org.apache.beam.model.job_management.v1.JobService/Run", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getJobs = GRPCMethodDescriptor( |
| name: "GetJobs", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetJobs", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getState = GRPCMethodDescriptor( |
| name: "GetState", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetState", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getPipeline = GRPCMethodDescriptor( |
| name: "GetPipeline", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetPipeline", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let cancel = GRPCMethodDescriptor( |
| name: "Cancel", |
| path: "/org.apache.beam.model.job_management.v1.JobService/Cancel", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getStateStream = GRPCMethodDescriptor( |
| name: "GetStateStream", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetStateStream", |
| type: GRPCCallType.serverStreaming |
| ) |
| |
| internal static let getMessageStream = GRPCMethodDescriptor( |
| name: "GetMessageStream", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetMessageStream", |
| type: GRPCCallType.serverStreaming |
| ) |
| |
| internal static let getJobMetrics = GRPCMethodDescriptor( |
| name: "GetJobMetrics", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetJobMetrics", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let describePipelineOptions = GRPCMethodDescriptor( |
| name: "DescribePipelineOptions", |
| path: "/org.apache.beam.model.job_management.v1.JobService/DescribePipelineOptions", |
| type: GRPCCallType.unary |
| ) |
| } |
| } |
| |
| /// Job Service for running RunnerAPI pipelines |
| /// |
| /// To build a server, implement a class that conforms to this protocol. |
| internal protocol Org_Apache_Beam_Model_JobManagement_V1_JobServiceProvider: CallHandlerProvider { |
| var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerInterceptorFactoryProtocol? { get } |
| |
| /// Prepare a job for execution. The job will not be executed until a call is made to run with the |
| /// returned preparationId. |
| func prepare(request: Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse> |
| |
| /// Submit the job for execution |
| func run(request: Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse> |
| |
| /// Get a list of all invoked jobs |
| func getJobs(request: Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse> |
| |
| /// Get the current state of the job |
| func getState(request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent> |
| |
| /// Get the job's pipeline |
| func getPipeline(request: Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse> |
| |
| /// Cancel the job |
| func cancel(request: Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse> |
| |
| /// Subscribe to a stream of state changes of the job, will immediately return the current state of the job as the first response. |
| func getStateStream(request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, context: StreamingResponseCallContext<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>) -> EventLoopFuture<GRPCStatus> |
| |
| /// Subscribe to a stream of state changes and messages from the job |
| func getMessageStream(request: Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, context: StreamingResponseCallContext<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse>) -> EventLoopFuture<GRPCStatus> |
| |
| /// Fetch metrics for a given job |
| func getJobMetrics(request: Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse> |
| |
| /// Get the supported pipeline options of the runner |
| func describePipelineOptions(request: Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse> |
| } |
| |
| extension Org_Apache_Beam_Model_JobManagement_V1_JobServiceProvider { |
| internal var serviceName: Substring { |
| return Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.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 "Prepare": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse>(), |
| interceptors: self.interceptors?.makePrepareInterceptors() ?? [], |
| userFunction: self.prepare(request:context:) |
| ) |
| |
| case "Run": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse>(), |
| interceptors: self.interceptors?.makeRunInterceptors() ?? [], |
| userFunction: self.run(request:context:) |
| ) |
| |
| case "GetJobs": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse>(), |
| interceptors: self.interceptors?.makeGetJobsInterceptors() ?? [], |
| userFunction: self.getJobs(request:context:) |
| ) |
| |
| case "GetState": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>(), |
| interceptors: self.interceptors?.makeGetStateInterceptors() ?? [], |
| userFunction: self.getState(request:context:) |
| ) |
| |
| case "GetPipeline": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse>(), |
| interceptors: self.interceptors?.makeGetPipelineInterceptors() ?? [], |
| userFunction: self.getPipeline(request:context:) |
| ) |
| |
| case "Cancel": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse>(), |
| interceptors: self.interceptors?.makeCancelInterceptors() ?? [], |
| userFunction: self.cancel(request:context:) |
| ) |
| |
| case "GetStateStream": |
| return ServerStreamingServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>(), |
| interceptors: self.interceptors?.makeGetStateStreamInterceptors() ?? [], |
| userFunction: self.getStateStream(request:context:) |
| ) |
| |
| case "GetMessageStream": |
| return ServerStreamingServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse>(), |
| interceptors: self.interceptors?.makeGetMessageStreamInterceptors() ?? [], |
| userFunction: self.getMessageStream(request:context:) |
| ) |
| |
| case "GetJobMetrics": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse>(), |
| interceptors: self.interceptors?.makeGetJobMetricsInterceptors() ?? [], |
| userFunction: self.getJobMetrics(request:context:) |
| ) |
| |
| case "DescribePipelineOptions": |
| return UnaryServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse>(), |
| interceptors: self.interceptors?.makeDescribePipelineOptionsInterceptors() ?? [], |
| userFunction: self.describePipelineOptions(request:context:) |
| ) |
| |
| default: |
| return nil |
| } |
| } |
| } |
| |
| /// Job Service for running RunnerAPI 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_JobManagement_V1_JobServiceAsyncProvider: CallHandlerProvider, Sendable { |
| static var serviceDescriptor: GRPCServiceDescriptor { get } |
| var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerInterceptorFactoryProtocol? { get } |
| |
| /// Prepare a job for execution. The job will not be executed until a call is made to run with the |
| /// returned preparationId. |
| func prepare( |
| request: Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse |
| |
| /// Submit the job for execution |
| func run( |
| request: Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse |
| |
| /// Get a list of all invoked jobs |
| func getJobs( |
| request: Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse |
| |
| /// Get the current state of the job |
| func getState( |
| request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent |
| |
| /// Get the job's pipeline |
| func getPipeline( |
| request: Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse |
| |
| /// Cancel the job |
| func cancel( |
| request: Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse |
| |
| /// Subscribe to a stream of state changes of the job, will immediately return the current state of the job as the first response. |
| func getStateStream( |
| request: Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, |
| responseStream: GRPCAsyncResponseStreamWriter<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>, |
| context: GRPCAsyncServerCallContext |
| ) async throws |
| |
| /// Subscribe to a stream of state changes and messages from the job |
| func getMessageStream( |
| request: Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, |
| responseStream: GRPCAsyncResponseStreamWriter<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse>, |
| context: GRPCAsyncServerCallContext |
| ) async throws |
| |
| /// Fetch metrics for a given job |
| func getJobMetrics( |
| request: Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse |
| |
| /// Get the supported pipeline options of the runner |
| func describePipelineOptions( |
| request: Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, |
| context: GRPCAsyncServerCallContext |
| ) async throws -> Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse |
| } |
| |
| @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) |
| extension Org_Apache_Beam_Model_JobManagement_V1_JobServiceAsyncProvider { |
| internal static var serviceDescriptor: GRPCServiceDescriptor { |
| return Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.serviceDescriptor |
| } |
| |
| internal var serviceName: Substring { |
| return Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.serviceDescriptor.fullName[...] |
| } |
| |
| internal var interceptors: Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerInterceptorFactoryProtocol? { |
| return nil |
| } |
| |
| internal func handle( |
| method name: Substring, |
| context: CallHandlerContext |
| ) -> GRPCServerHandlerProtocol? { |
| switch name { |
| case "Prepare": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse>(), |
| interceptors: self.interceptors?.makePrepareInterceptors() ?? [], |
| wrapping: { try await self.prepare(request: $0, context: $1) } |
| ) |
| |
| case "Run": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse>(), |
| interceptors: self.interceptors?.makeRunInterceptors() ?? [], |
| wrapping: { try await self.run(request: $0, context: $1) } |
| ) |
| |
| case "GetJobs": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse>(), |
| interceptors: self.interceptors?.makeGetJobsInterceptors() ?? [], |
| wrapping: { try await self.getJobs(request: $0, context: $1) } |
| ) |
| |
| case "GetState": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>(), |
| interceptors: self.interceptors?.makeGetStateInterceptors() ?? [], |
| wrapping: { try await self.getState(request: $0, context: $1) } |
| ) |
| |
| case "GetPipeline": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse>(), |
| interceptors: self.interceptors?.makeGetPipelineInterceptors() ?? [], |
| wrapping: { try await self.getPipeline(request: $0, context: $1) } |
| ) |
| |
| case "Cancel": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse>(), |
| interceptors: self.interceptors?.makeCancelInterceptors() ?? [], |
| wrapping: { try await self.cancel(request: $0, context: $1) } |
| ) |
| |
| case "GetStateStream": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>(), |
| interceptors: self.interceptors?.makeGetStateStreamInterceptors() ?? [], |
| wrapping: { try await self.getStateStream(request: $0, responseStream: $1, context: $2) } |
| ) |
| |
| case "GetMessageStream": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse>(), |
| interceptors: self.interceptors?.makeGetMessageStreamInterceptors() ?? [], |
| wrapping: { try await self.getMessageStream(request: $0, responseStream: $1, context: $2) } |
| ) |
| |
| case "GetJobMetrics": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse>(), |
| interceptors: self.interceptors?.makeGetJobMetricsInterceptors() ?? [], |
| wrapping: { try await self.getJobMetrics(request: $0, context: $1) } |
| ) |
| |
| case "DescribePipelineOptions": |
| return GRPCAsyncServerHandler( |
| context: context, |
| requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest>(), |
| responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse>(), |
| interceptors: self.interceptors?.makeDescribePipelineOptionsInterceptors() ?? [], |
| wrapping: { try await self.describePipelineOptions(request: $0, context: $1) } |
| ) |
| |
| default: |
| return nil |
| } |
| } |
| } |
| |
| internal protocol Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerInterceptorFactoryProtocol: Sendable { |
| |
| /// - Returns: Interceptors to use when handling 'prepare'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makePrepareInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_PrepareJobRequest, Org_Apache_Beam_Model_JobManagement_V1_PrepareJobResponse>] |
| |
| /// - Returns: Interceptors to use when handling 'run'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeRunInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_RunJobRequest, Org_Apache_Beam_Model_JobManagement_V1_RunJobResponse>] |
| |
| /// - Returns: Interceptors to use when handling 'getJobs'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeGetJobsInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobsResponse>] |
| |
| /// - Returns: Interceptors to use when handling 'getState'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeGetStateInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>] |
| |
| /// - Returns: Interceptors to use when handling 'getPipeline'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeGetPipelineInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobPipelineResponse>] |
| |
| /// - Returns: Interceptors to use when handling 'cancel'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeCancelInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_CancelJobRequest, Org_Apache_Beam_Model_JobManagement_V1_CancelJobResponse>] |
| |
| /// - Returns: Interceptors to use when handling 'getStateStream'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeGetStateStreamInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobStateRequest, Org_Apache_Beam_Model_JobManagement_V1_JobStateEvent>] |
| |
| /// - Returns: Interceptors to use when handling 'getMessageStream'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeGetMessageStreamInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_JobMessagesRequest, Org_Apache_Beam_Model_JobManagement_V1_JobMessagesResponse>] |
| |
| /// - Returns: Interceptors to use when handling 'getJobMetrics'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeGetJobMetricsInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsRequest, Org_Apache_Beam_Model_JobManagement_V1_GetJobMetricsResponse>] |
| |
| /// - Returns: Interceptors to use when handling 'describePipelineOptions'. |
| /// Defaults to calling `self.makeInterceptors()`. |
| func makeDescribePipelineOptionsInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsRequest, Org_Apache_Beam_Model_JobManagement_V1_DescribePipelineOptionsResponse>] |
| } |
| |
| internal enum Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata { |
| internal static let serviceDescriptor = GRPCServiceDescriptor( |
| name: "JobService", |
| fullName: "org.apache.beam.model.job_management.v1.JobService", |
| methods: [ |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.prepare, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.run, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.getJobs, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.getState, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.getPipeline, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.cancel, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.getStateStream, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.getMessageStream, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.getJobMetrics, |
| Org_Apache_Beam_Model_JobManagement_V1_JobServiceServerMetadata.Methods.describePipelineOptions, |
| ] |
| ) |
| |
| internal enum Methods { |
| internal static let prepare = GRPCMethodDescriptor( |
| name: "Prepare", |
| path: "/org.apache.beam.model.job_management.v1.JobService/Prepare", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let run = GRPCMethodDescriptor( |
| name: "Run", |
| path: "/org.apache.beam.model.job_management.v1.JobService/Run", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getJobs = GRPCMethodDescriptor( |
| name: "GetJobs", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetJobs", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getState = GRPCMethodDescriptor( |
| name: "GetState", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetState", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getPipeline = GRPCMethodDescriptor( |
| name: "GetPipeline", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetPipeline", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let cancel = GRPCMethodDescriptor( |
| name: "Cancel", |
| path: "/org.apache.beam.model.job_management.v1.JobService/Cancel", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let getStateStream = GRPCMethodDescriptor( |
| name: "GetStateStream", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetStateStream", |
| type: GRPCCallType.serverStreaming |
| ) |
| |
| internal static let getMessageStream = GRPCMethodDescriptor( |
| name: "GetMessageStream", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetMessageStream", |
| type: GRPCCallType.serverStreaming |
| ) |
| |
| internal static let getJobMetrics = GRPCMethodDescriptor( |
| name: "GetJobMetrics", |
| path: "/org.apache.beam.model.job_management.v1.JobService/GetJobMetrics", |
| type: GRPCCallType.unary |
| ) |
| |
| internal static let describePipelineOptions = GRPCMethodDescriptor( |
| name: "DescribePipelineOptions", |
| path: "/org.apache.beam.model.job_management.v1.JobService/DescribePipelineOptions", |
| type: GRPCCallType.unary |
| ) |
| } |
| } |