All Downloads are FREE. Search and download functionalities are using the official Maven repository.

build.bazel.remote.asset.v1.PushClientStub.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 PushClientStub(channel: Channel, callOptions: CallOptions = CallOptions.DEFAULT) :
        AbstractStub(channel, callOptions) {
    private val pushBlobDescriptor: MethodDescriptor by lazy {
            MethodDescriptor.newBuilder()
                .setType(MethodDescriptor.MethodType.UNARY)
                .setFullMethodName(generateFullMethodName("build.bazel.remote.asset.v1.Push",
                    "PushBlob"))
                .setSampledToLocalTracing(true)
                .setRequestMarshaller(ProtoUtils.marshaller(
                    PushBlobRequest.getDefaultInstance()))
                .setResponseMarshaller(ProtoUtils.marshaller(
                    PushBlobResponse.getDefaultInstance()))
                .build()

            }

    private val pushDirectoryDescriptor: MethodDescriptor by lazy {
            MethodDescriptor.newBuilder()
                .setType(MethodDescriptor.MethodType.UNARY)
                .setFullMethodName(generateFullMethodName("build.bazel.remote.asset.v1.Push",
                    "PushDirectory"))
                .setSampledToLocalTracing(true)
                .setRequestMarshaller(ProtoUtils.marshaller(
                    PushDirectoryRequest.getDefaultInstance()))
                .setResponseMarshaller(ProtoUtils.marshaller(
                    PushDirectoryResponse.getDefaultInstance()))
                .build()

            }

    override fun build(channel: Channel, callOptions: CallOptions): PushClientStub =
            PushClientStub(channel, callOptions)

    fun pushBlob(request: PushBlobRequest): ListenableFuture = futureUnaryCall(
        channel.newCall(pushBlobDescriptor, callOptions),
        request
    )


    fun pushDirectory(request: PushDirectoryRequest): ListenableFuture =
            futureUnaryCall(
        channel.newCall(pushDirectoryDescriptor, callOptions),
        request
    )

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy