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

build.bazel.remote.execution.v2.RemoteExecutionProtoGrpcKt.kt Maven / Gradle / Ivy

package build.bazel.remote.execution.v2

import com.google.longrunning.Operation
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.serverStreamingRpc
import io.grpc.kotlin.ClientCalls.unaryRpc
import io.grpc.kotlin.ServerCalls.serverStreamingServerMethodDefinition
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 kotlinx.coroutines.flow.Flow
import build.bazel.remote.execution.v2.ActionCacheGrpc.getServiceDescriptor as actionCacheGrpcGetServiceDescriptor
import build.bazel.remote.execution.v2.CapabilitiesGrpc.getServiceDescriptor as capabilitiesGrpcGetServiceDescriptor
import build.bazel.remote.execution.v2.ContentAddressableStorageGrpc.getServiceDescriptor as contentAddressableStorageGrpcGetServiceDescriptor
import build.bazel.remote.execution.v2.ExecutionGrpc.getServiceDescriptor as executionGrpcGetServiceDescriptor

/**
 * Holder for Kotlin coroutine-based client and server APIs for
 * build.bazel.remote.execution.v2.Execution.
 */
public object ExecutionGrpcKt {
  public const val SERVICE_NAME: String = ExecutionGrpc.SERVICE_NAME

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

  public val executeMethod: MethodDescriptor
    @JvmStatic
    get() = ExecutionGrpc.getExecuteMethod()

  public val waitExecutionMethod: MethodDescriptor
    @JvmStatic
    get() = ExecutionGrpc.getWaitExecutionMethod()

  /**
   * A stub for issuing RPCs to a(n) build.bazel.remote.execution.v2.Execution service as suspending
   * coroutines.
   */
  @StubFor(ExecutionGrpc::class)
  public class ExecutionCoroutineStub @JvmOverloads constructor(
    channel: Channel,
    callOptions: CallOptions = DEFAULT,
  ) : AbstractCoroutineStub(channel, callOptions) {
    override fun build(channel: Channel, callOptions: CallOptions): ExecutionCoroutineStub =
        ExecutionCoroutineStub(channel, callOptions)

    /**
     * Returns a [Flow] that, when collected, executes this RPC and emits responses from the
     * server as they arrive.  That flow finishes normally if the server closes its response with
     * [`Status.OK`][io.grpc.Status], and fails by throwing a [StatusException] otherwise.  If
     * collecting the flow downstream fails exceptionally (including via cancellation), the RPC
     * is cancelled with that 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 A flow that, when collected, emits the responses from the server.
     */
    public fun execute(request: ExecuteRequest, headers: Metadata = Metadata()): Flow =
        serverStreamingRpc(
      channel,
      ExecutionGrpc.getExecuteMethod(),
      request,
      callOptions,
      headers
    )

    /**
     * Returns a [Flow] that, when collected, executes this RPC and emits responses from the
     * server as they arrive.  That flow finishes normally if the server closes its response with
     * [`Status.OK`][io.grpc.Status], and fails by throwing a [StatusException] otherwise.  If
     * collecting the flow downstream fails exceptionally (including via cancellation), the RPC
     * is cancelled with that 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 A flow that, when collected, emits the responses from the server.
     */
    public fun waitExecution(request: WaitExecutionRequest, headers: Metadata = Metadata()):
        Flow = serverStreamingRpc(
      channel,
      ExecutionGrpc.getWaitExecutionMethod(),
      request,
      callOptions,
      headers
    )
  }

  /**
   * Skeletal implementation of the build.bazel.remote.execution.v2.Execution service based on
   * Kotlin coroutines.
   */
  public abstract class ExecutionCoroutineImplBase(
    coroutineContext: CoroutineContext = EmptyCoroutineContext,
  ) : AbstractCoroutineServerImpl(coroutineContext) {
    /**
     * Returns a [Flow] of responses to an RPC for
     * build.bazel.remote.execution.v2.Execution.Execute.
     *
     * If creating or collecting the returned flow fails with a [StatusException], the RPC
     * will fail with the corresponding [io.grpc.Status].  If it fails with a
     * [java.util.concurrent.CancellationException], the RPC will fail with status
     * `Status.CANCELLED`.  If creating
     * or collecting the returned flow 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 fun execute(request: ExecuteRequest): Flow = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.Execution.Execute is unimplemented"))

    /**
     * Returns a [Flow] of responses to an RPC for
     * build.bazel.remote.execution.v2.Execution.WaitExecution.
     *
     * If creating or collecting the returned flow fails with a [StatusException], the RPC
     * will fail with the corresponding [io.grpc.Status].  If it fails with a
     * [java.util.concurrent.CancellationException], the RPC will fail with status
     * `Status.CANCELLED`.  If creating
     * or collecting the returned flow 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 fun waitExecution(request: WaitExecutionRequest): Flow = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.Execution.WaitExecution is unimplemented"))

    final override fun bindService(): ServerServiceDefinition =
        builder(executionGrpcGetServiceDescriptor())
      .addMethod(serverStreamingServerMethodDefinition(
      context = this.context,
      descriptor = ExecutionGrpc.getExecuteMethod(),
      implementation = ::execute
    ))
      .addMethod(serverStreamingServerMethodDefinition(
      context = this.context,
      descriptor = ExecutionGrpc.getWaitExecutionMethod(),
      implementation = ::waitExecution
    )).build()
  }
}

/**
 * Holder for Kotlin coroutine-based client and server APIs for
 * build.bazel.remote.execution.v2.ActionCache.
 */
public object ActionCacheGrpcKt {
  public const val SERVICE_NAME: String = ActionCacheGrpc.SERVICE_NAME

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

  public val getActionResultMethod: MethodDescriptor
    @JvmStatic
    get() = ActionCacheGrpc.getGetActionResultMethod()

  public val updateActionResultMethod: MethodDescriptor
    @JvmStatic
    get() = ActionCacheGrpc.getUpdateActionResultMethod()

  /**
   * A stub for issuing RPCs to a(n) build.bazel.remote.execution.v2.ActionCache service as
   * suspending coroutines.
   */
  @StubFor(ActionCacheGrpc::class)
  public class ActionCacheCoroutineStub @JvmOverloads constructor(
    channel: Channel,
    callOptions: CallOptions = DEFAULT,
  ) : AbstractCoroutineStub(channel, callOptions) {
    override fun build(channel: Channel, callOptions: CallOptions): ActionCacheCoroutineStub =
        ActionCacheCoroutineStub(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 getActionResult(request: GetActionResultRequest, headers: Metadata =
        Metadata()): ActionResult = unaryRpc(
      channel,
      ActionCacheGrpc.getGetActionResultMethod(),
      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 updateActionResult(request: UpdateActionResultRequest, headers: Metadata =
        Metadata()): ActionResult = unaryRpc(
      channel,
      ActionCacheGrpc.getUpdateActionResultMethod(),
      request,
      callOptions,
      headers
    )
  }

  /**
   * Skeletal implementation of the build.bazel.remote.execution.v2.ActionCache service based on
   * Kotlin coroutines.
   */
  public abstract class ActionCacheCoroutineImplBase(
    coroutineContext: CoroutineContext = EmptyCoroutineContext,
  ) : AbstractCoroutineServerImpl(coroutineContext) {
    /**
     * Returns the response to an RPC for
     * build.bazel.remote.execution.v2.ActionCache.GetActionResult.
     *
     * 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 getActionResult(request: GetActionResultRequest): ActionResult = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.ActionCache.GetActionResult is unimplemented"))

    /**
     * Returns the response to an RPC for
     * build.bazel.remote.execution.v2.ActionCache.UpdateActionResult.
     *
     * 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 updateActionResult(request: UpdateActionResultRequest): ActionResult =
        throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.ActionCache.UpdateActionResult is unimplemented"))

    final override fun bindService(): ServerServiceDefinition =
        builder(actionCacheGrpcGetServiceDescriptor())
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = ActionCacheGrpc.getGetActionResultMethod(),
      implementation = ::getActionResult
    ))
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = ActionCacheGrpc.getUpdateActionResultMethod(),
      implementation = ::updateActionResult
    )).build()
  }
}

/**
 * Holder for Kotlin coroutine-based client and server APIs for
 * build.bazel.remote.execution.v2.ContentAddressableStorage.
 */
public object ContentAddressableStorageGrpcKt {
  public const val SERVICE_NAME: String = ContentAddressableStorageGrpc.SERVICE_NAME

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

  public val findMissingBlobsMethod:
      MethodDescriptor
    @JvmStatic
    get() = ContentAddressableStorageGrpc.getFindMissingBlobsMethod()

  public val batchUpdateBlobsMethod:
      MethodDescriptor
    @JvmStatic
    get() = ContentAddressableStorageGrpc.getBatchUpdateBlobsMethod()

  public val batchReadBlobsMethod: MethodDescriptor
    @JvmStatic
    get() = ContentAddressableStorageGrpc.getBatchReadBlobsMethod()

  public val getTreeMethod: MethodDescriptor
    @JvmStatic
    get() = ContentAddressableStorageGrpc.getGetTreeMethod()

  /**
   * A stub for issuing RPCs to a(n) build.bazel.remote.execution.v2.ContentAddressableStorage
   * service as suspending coroutines.
   */
  @StubFor(ContentAddressableStorageGrpc::class)
  public class ContentAddressableStorageCoroutineStub @JvmOverloads constructor(
    channel: Channel,
    callOptions: CallOptions = DEFAULT,
  ) : AbstractCoroutineStub(channel, callOptions) {
    override fun build(channel: Channel, callOptions: CallOptions):
        ContentAddressableStorageCoroutineStub = ContentAddressableStorageCoroutineStub(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 findMissingBlobs(request: FindMissingBlobsRequest, headers: Metadata =
        Metadata()): FindMissingBlobsResponse = unaryRpc(
      channel,
      ContentAddressableStorageGrpc.getFindMissingBlobsMethod(),
      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 batchUpdateBlobs(request: BatchUpdateBlobsRequest, headers: Metadata =
        Metadata()): BatchUpdateBlobsResponse = unaryRpc(
      channel,
      ContentAddressableStorageGrpc.getBatchUpdateBlobsMethod(),
      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 batchReadBlobs(request: BatchReadBlobsRequest, headers: Metadata =
        Metadata()): BatchReadBlobsResponse = unaryRpc(
      channel,
      ContentAddressableStorageGrpc.getBatchReadBlobsMethod(),
      request,
      callOptions,
      headers
    )

    /**
     * Returns a [Flow] that, when collected, executes this RPC and emits responses from the
     * server as they arrive.  That flow finishes normally if the server closes its response with
     * [`Status.OK`][io.grpc.Status], and fails by throwing a [StatusException] otherwise.  If
     * collecting the flow downstream fails exceptionally (including via cancellation), the RPC
     * is cancelled with that 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 A flow that, when collected, emits the responses from the server.
     */
    public fun getTree(request: GetTreeRequest, headers: Metadata = Metadata()):
        Flow = serverStreamingRpc(
      channel,
      ContentAddressableStorageGrpc.getGetTreeMethod(),
      request,
      callOptions,
      headers
    )
  }

  /**
   * Skeletal implementation of the build.bazel.remote.execution.v2.ContentAddressableStorage
   * service based on Kotlin coroutines.
   */
  public abstract class ContentAddressableStorageCoroutineImplBase(
    coroutineContext: CoroutineContext = EmptyCoroutineContext,
  ) : AbstractCoroutineServerImpl(coroutineContext) {
    /**
     * Returns the response to an RPC for
     * build.bazel.remote.execution.v2.ContentAddressableStorage.FindMissingBlobs.
     *
     * 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 findMissingBlobs(request: FindMissingBlobsRequest):
        FindMissingBlobsResponse = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.ContentAddressableStorage.FindMissingBlobs is unimplemented"))

    /**
     * Returns the response to an RPC for
     * build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs.
     *
     * 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 batchUpdateBlobs(request: BatchUpdateBlobsRequest):
        BatchUpdateBlobsResponse = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs is unimplemented"))

    /**
     * Returns the response to an RPC for
     * build.bazel.remote.execution.v2.ContentAddressableStorage.BatchReadBlobs.
     *
     * 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 batchReadBlobs(request: BatchReadBlobsRequest): BatchReadBlobsResponse =
        throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.ContentAddressableStorage.BatchReadBlobs is unimplemented"))

    /**
     * Returns a [Flow] of responses to an RPC for
     * build.bazel.remote.execution.v2.ContentAddressableStorage.GetTree.
     *
     * If creating or collecting the returned flow fails with a [StatusException], the RPC
     * will fail with the corresponding [io.grpc.Status].  If it fails with a
     * [java.util.concurrent.CancellationException], the RPC will fail with status
     * `Status.CANCELLED`.  If creating
     * or collecting the returned flow 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 fun getTree(request: GetTreeRequest): Flow = throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.ContentAddressableStorage.GetTree is unimplemented"))

    final override fun bindService(): ServerServiceDefinition =
        builder(contentAddressableStorageGrpcGetServiceDescriptor())
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = ContentAddressableStorageGrpc.getFindMissingBlobsMethod(),
      implementation = ::findMissingBlobs
    ))
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = ContentAddressableStorageGrpc.getBatchUpdateBlobsMethod(),
      implementation = ::batchUpdateBlobs
    ))
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = ContentAddressableStorageGrpc.getBatchReadBlobsMethod(),
      implementation = ::batchReadBlobs
    ))
      .addMethod(serverStreamingServerMethodDefinition(
      context = this.context,
      descriptor = ContentAddressableStorageGrpc.getGetTreeMethod(),
      implementation = ::getTree
    )).build()
  }
}

/**
 * Holder for Kotlin coroutine-based client and server APIs for
 * build.bazel.remote.execution.v2.Capabilities.
 */
public object CapabilitiesGrpcKt {
  public const val SERVICE_NAME: String = CapabilitiesGrpc.SERVICE_NAME

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

  public val getCapabilitiesMethod: MethodDescriptor
    @JvmStatic
    get() = CapabilitiesGrpc.getGetCapabilitiesMethod()

  /**
   * A stub for issuing RPCs to a(n) build.bazel.remote.execution.v2.Capabilities service as
   * suspending coroutines.
   */
  @StubFor(CapabilitiesGrpc::class)
  public class CapabilitiesCoroutineStub @JvmOverloads constructor(
    channel: Channel,
    callOptions: CallOptions = DEFAULT,
  ) : AbstractCoroutineStub(channel, callOptions) {
    override fun build(channel: Channel, callOptions: CallOptions): CapabilitiesCoroutineStub =
        CapabilitiesCoroutineStub(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 getCapabilities(request: GetCapabilitiesRequest, headers: Metadata =
        Metadata()): ServerCapabilities = unaryRpc(
      channel,
      CapabilitiesGrpc.getGetCapabilitiesMethod(),
      request,
      callOptions,
      headers
    )
  }

  /**
   * Skeletal implementation of the build.bazel.remote.execution.v2.Capabilities service based on
   * Kotlin coroutines.
   */
  public abstract class CapabilitiesCoroutineImplBase(
    coroutineContext: CoroutineContext = EmptyCoroutineContext,
  ) : AbstractCoroutineServerImpl(coroutineContext) {
    /**
     * Returns the response to an RPC for
     * build.bazel.remote.execution.v2.Capabilities.GetCapabilities.
     *
     * 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 getCapabilities(request: GetCapabilitiesRequest): ServerCapabilities =
        throw
        StatusException(UNIMPLEMENTED.withDescription("Method build.bazel.remote.execution.v2.Capabilities.GetCapabilities is unimplemented"))

    final override fun bindService(): ServerServiceDefinition =
        builder(capabilitiesGrpcGetServiceDescriptor())
      .addMethod(unaryServerMethodDefinition(
      context = this.context,
      descriptor = CapabilitiesGrpc.getGetCapabilitiesMethod(),
      implementation = ::getCapabilities
    )).build()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy