build.bazel.remote.asset.v1.FetchClientStub.kt Maven / Gradle / Ivy
package build.bazel.remote.asset.v1
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 FetchClientStub(channel: Channel, callOptions: CallOptions = CallOptions.DEFAULT) :
AbstractStub(channel, callOptions) {
private val fetchBlobDescriptor: MethodDescriptor by lazy {
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName("build.bazel.remote.asset.v1.Fetch",
"FetchBlob"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(ProtoUtils.marshaller(
FetchBlobRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(
FetchBlobResponse.getDefaultInstance()))
.build()
}
private val fetchDirectoryDescriptor: MethodDescriptor by lazy {
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName("build.bazel.remote.asset.v1.Fetch",
"FetchDirectory"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(ProtoUtils.marshaller(
FetchDirectoryRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(
FetchDirectoryResponse.getDefaultInstance()))
.build()
}
override fun build(channel: Channel, callOptions: CallOptions): FetchClientStub =
FetchClientStub(channel, callOptions)
fun fetchBlob(request: FetchBlobRequest): ListenableFuture = futureUnaryCall(
channel.newCall(fetchBlobDescriptor, callOptions),
request
)
fun fetchDirectory(request: FetchDirectoryRequest): ListenableFuture =
futureUnaryCall(
channel.newCall(fetchDirectoryDescriptor, callOptions),
request
)
}