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

build.bazel.remote.asset.v1.RemoteAssetProtoGrpcKt.kt Maven / Gradle / Ivy

package build.bazel.remote.asset.v1

import io.grpc.CallOptions
import io.grpc.CallOptions.DEFAULT
import io.grpc.Channel
import io.grpc.Metadata
import io.grpc.MethodDescriptor
import io.grpc.ServerServiceDefinition
import io.grpc.ServerServiceDefinition.builder
import io.grpc.ServiceDescriptor
import io.grpc.Status.UNIMPLEMENTED
import io.grpc.StatusException
import io.grpc.kotlin.AbstractCoroutineServerImpl
import io.grpc.kotlin.AbstractCoroutineStub
import io.grpc.kotlin.ClientCalls.unaryRpc
import io.grpc.kotlin.ServerCalls.unaryServerMethodDefinition
import io.grpc.kotlin.StubFor
import kotlin.String
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
import kotlin.jvm.JvmOverloads
import kotlin.jvm.JvmStatic
import build.bazel.remote.asset.v1.FetchGrpc.getServiceDescriptor as fetchGrpcGetServiceDescriptor
import build.bazel.remote.asset.v1.PushGrpc.getServiceDescriptor as pushGrpcGetServiceDescriptor

/**
 * Holder for Kotlin coroutine-based client and server APIs for build.bazel.remote.asset.v1.Fetch.
 */
public object FetchGrpcKt {
  public const val SERVICE_NAME: String = FetchGrpc.SERVICE_NAME

  @JvmStatic
  public val serviceDescriptor: ServiceDescriptor
    get() = fetchGrpcGetServiceDescriptor()

  public val fetchBlobMethod: MethodDescriptor
    @JvmStatic
    get() = FetchGrpc.getFetchBlobMethod()

  public val fetchDirectoryMethod: MethodDescriptor
    @JvmStatic
    get() = FetchGrpc.getFetchDirectoryMethod()

  /**
   * A stub for issuing RPCs to a(n) build.bazel.remote.asset.v1.Fetch service as suspending
   * coroutines.
   */
  @StubFor(FetchGrpc::class)
  public class FetchCoroutineStub @JvmOverloads constructor(
    channel: Channel,
    callOptions: CallOptions = DEFAULT,
  ) : AbstractCoroutineStub(channel, callOptions) {
    override fun build(channel: Channel, callOptions: CallOptions): FetchCoroutineStub =
        FetchCoroutineStub(channel, callOptions)

    /**
     * Executes this RPC and returns the response message, suspending until the RPC completes
     * with [`Status.OK`][io.grpc.Status].  If the RPC completes with another status, a
     * corresponding
     * [StatusException] is thrown.  If this coroutine is cancelled, the RPC is also cancelled
     * with the corresponding exception as a cause.
     *
     * @param request The request message to send to the server.
     *
     * @param headers Metadata to attach to the request.  Most users will not need this.
     *
     * @return The single response from the server.
     */
    public suspend fun fetchBlob(request: FetchBlobRequest, headers: Metadata = Metadata()):
        FetchBlobResponse = unaryRpc(
      channel,
      FetchGrpc.getFetchBlobMethod(),
      request,
      callOptions,
      headers
    )

    /**
     * Executes this RPC and returns the response message, suspending until the RPC completes
     * with [`Status.OK`][io.grpc.Status].  If the RPC completes with another status, a
     * corresponding
     * [StatusException] is thrown.  If this coroutine is cancelled, the RPC is also cancelled
     * with the corresponding exception as a cause.
     *
     * @param request The request message to send to the server.
     *
     * @param headers Metadata to attach to the request.  Most users will not need this.
     *
     * @return The single response from the server.
     */
    public suspend fun fetchDirectory(request: FetchDirectoryRequest, headers: Metadata =
        Metadata()): FetchDirectoryResponse = unaryRpc(
      channel,
      FetchGrpc.getFetchDirectoryMethod(),
      request,
      callOptions,
      headers
    )
  }

  /**
   * Skeletal implementation of the build.bazel.remote.asset.v1.Fetch service based on Kotlin
   * coroutines.
   */
  public abstract class FetchCoroutineImplBase(
    coroutineContext: CoroutineContext = EmptyCoroutineContext,
  ) : AbstractCoroutineServerImpl(coroutineContext) {
    /**
     * Returns the response to an RPC for build.bazel.remote.asset.v1.Fetch.FetchBlob.
     *
     * If this method fails with a [StatusException], the RPC will fail with the corresponding
     * [io.grpc.Status].  If this method fails with a [java.util.concurrent.CancellationException],
     * the RPC will fail
     * with status `Status.CANCELLED`.  If this method fails for any other reason, the RPC will
     * fail with `Status.UNKNOWN` with the exception as a cause.
     *
     * @param request The request from the client.
     */
    public open suspend fun fetchBlob(request: FetchBlobRequest): FetchBlobResponse = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.asset.v1.Fetch.FetchBlob is unimplemented"))

    /**
     * Returns the response to an RPC for build.bazel.remote.asset.v1.Fetch.FetchDirectory.
     *
     * If this method fails with a [StatusException], the RPC will fail with the corresponding
     * [io.grpc.Status].  If this method fails with a [java.util.concurrent.CancellationException],
     * the RPC will fail
     * with status `Status.CANCELLED`.  If this method fails for any other reason, the RPC will
     * fail with `Status.UNKNOWN` with the exception as a cause.
     *
     * @param request The request from the client.
     */
    public open suspend fun fetchDirectory(request: FetchDirectoryRequest): FetchDirectoryResponse =
        throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.asset.v1.Fetch.FetchDirectory is unimplemented"))

    final override fun bindService(): ServerServiceDefinition =
        builder(fetchGrpcGetServiceDescriptor())
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = FetchGrpc.getFetchBlobMethod(),
      implementation = ::fetchBlob
    ))
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = FetchGrpc.getFetchDirectoryMethod(),
      implementation = ::fetchDirectory
    )).build()
  }
}

/**
 * Holder for Kotlin coroutine-based client and server APIs for build.bazel.remote.asset.v1.Push.
 */
public object PushGrpcKt {
  public const val SERVICE_NAME: String = PushGrpc.SERVICE_NAME

  @JvmStatic
  public val serviceDescriptor: ServiceDescriptor
    get() = pushGrpcGetServiceDescriptor()

  public val pushBlobMethod: MethodDescriptor
    @JvmStatic
    get() = PushGrpc.getPushBlobMethod()

  public val pushDirectoryMethod: MethodDescriptor
    @JvmStatic
    get() = PushGrpc.getPushDirectoryMethod()

  /**
   * A stub for issuing RPCs to a(n) build.bazel.remote.asset.v1.Push service as suspending
   * coroutines.
   */
  @StubFor(PushGrpc::class)
  public class PushCoroutineStub @JvmOverloads constructor(
    channel: Channel,
    callOptions: CallOptions = DEFAULT,
  ) : AbstractCoroutineStub(channel, callOptions) {
    override fun build(channel: Channel, callOptions: CallOptions): PushCoroutineStub =
        PushCoroutineStub(channel, callOptions)

    /**
     * Executes this RPC and returns the response message, suspending until the RPC completes
     * with [`Status.OK`][io.grpc.Status].  If the RPC completes with another status, a
     * corresponding
     * [StatusException] is thrown.  If this coroutine is cancelled, the RPC is also cancelled
     * with the corresponding exception as a cause.
     *
     * @param request The request message to send to the server.
     *
     * @param headers Metadata to attach to the request.  Most users will not need this.
     *
     * @return The single response from the server.
     */
    public suspend fun pushBlob(request: PushBlobRequest, headers: Metadata = Metadata()):
        PushBlobResponse = unaryRpc(
      channel,
      PushGrpc.getPushBlobMethod(),
      request,
      callOptions,
      headers
    )

    /**
     * Executes this RPC and returns the response message, suspending until the RPC completes
     * with [`Status.OK`][io.grpc.Status].  If the RPC completes with another status, a
     * corresponding
     * [StatusException] is thrown.  If this coroutine is cancelled, the RPC is also cancelled
     * with the corresponding exception as a cause.
     *
     * @param request The request message to send to the server.
     *
     * @param headers Metadata to attach to the request.  Most users will not need this.
     *
     * @return The single response from the server.
     */
    public suspend fun pushDirectory(request: PushDirectoryRequest, headers: Metadata = Metadata()):
        PushDirectoryResponse = unaryRpc(
      channel,
      PushGrpc.getPushDirectoryMethod(),
      request,
      callOptions,
      headers
    )
  }

  /**
   * Skeletal implementation of the build.bazel.remote.asset.v1.Push service based on Kotlin
   * coroutines.
   */
  public abstract class PushCoroutineImplBase(
    coroutineContext: CoroutineContext = EmptyCoroutineContext,
  ) : AbstractCoroutineServerImpl(coroutineContext) {
    /**
     * Returns the response to an RPC for build.bazel.remote.asset.v1.Push.PushBlob.
     *
     * If this method fails with a [StatusException], the RPC will fail with the corresponding
     * [io.grpc.Status].  If this method fails with a [java.util.concurrent.CancellationException],
     * the RPC will fail
     * with status `Status.CANCELLED`.  If this method fails for any other reason, the RPC will
     * fail with `Status.UNKNOWN` with the exception as a cause.
     *
     * @param request The request from the client.
     */
    public open suspend fun pushBlob(request: PushBlobRequest): PushBlobResponse = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.asset.v1.Push.PushBlob is unimplemented"))

    /**
     * Returns the response to an RPC for build.bazel.remote.asset.v1.Push.PushDirectory.
     *
     * If this method fails with a [StatusException], the RPC will fail with the corresponding
     * [io.grpc.Status].  If this method fails with a [java.util.concurrent.CancellationException],
     * the RPC will fail
     * with status `Status.CANCELLED`.  If this method fails for any other reason, the RPC will
     * fail with `Status.UNKNOWN` with the exception as a cause.
     *
     * @param request The request from the client.
     */
    public open suspend fun pushDirectory(request: PushDirectoryRequest): PushDirectoryResponse =
        throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.asset.v1.Push.PushDirectory is unimplemented"))

    final override fun bindService(): ServerServiceDefinition =
        builder(pushGrpcGetServiceDescriptor())
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = PushGrpc.getPushBlobMethod(),
      implementation = ::pushBlob
    ))
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = PushGrpc.getPushDirectoryMethod(),
      implementation = ::pushDirectory
    )).build()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy