build.bazel.remote.execution.v2.ActionCacheClientStub.kt Maven / Gradle / Ivy
package build.bazel.remote.execution.v2
import com.google.common.util.concurrent.ListenableFuture
import io.grpc.CallOptions
import io.grpc.Channel
import io.grpc.MethodDescriptor
import io.grpc.MethodDescriptor.MethodType
import io.grpc.MethodDescriptor.generateFullMethodName
import io.grpc.Status.Code
import io.grpc.protobuf.ProtoUtils
import io.grpc.stub.AbstractStub
import io.grpc.stub.ClientCalls.asyncBidiStreamingCall
import io.grpc.stub.ClientCalls.asyncClientStreamingCall
import io.grpc.stub.ClientCalls.asyncServerStreamingCall
import io.grpc.stub.ClientCalls.futureUnaryCall
import javax.annotation.Generated
@Generated("com.google.api.kotlin.generator.GRPCGenerator")
class ActionCacheClientStub(channel: Channel, callOptions: CallOptions = CallOptions.DEFAULT) :
AbstractStub(channel, callOptions) {
private val getActionResultDescriptor: MethodDescriptor by
lazy {
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName("build.bazel.remote.execution.v2.ActionCache",
"GetActionResult"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(ProtoUtils.marshaller(
GetActionResultRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(
ActionResult.getDefaultInstance()))
.build()
}
private val updateActionResultDescriptor: MethodDescriptor by lazy {
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName("build.bazel.remote.execution.v2.ActionCache",
"UpdateActionResult"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(ProtoUtils.marshaller(
UpdateActionResultRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(
ActionResult.getDefaultInstance()))
.build()
}
override fun build(channel: Channel, callOptions: CallOptions): ActionCacheClientStub =
ActionCacheClientStub(channel, callOptions)
fun getActionResult(request: GetActionResultRequest): ListenableFuture =
futureUnaryCall(
channel.newCall(getActionResultDescriptor, callOptions),
request
)
fun updateActionResult(request: UpdateActionResultRequest): ListenableFuture =
futureUnaryCall(
channel.newCall(updateActionResultDescriptor, callOptions),
request
)
}