
cosmos.base.tendermint.v1beta1.QueryGrpcKt.kt Maven / Gradle / Ivy
package cosmos.base.tendermint.v1beta1
import cosmos.base.tendermint.v1beta1.ServiceGrpc.getServiceDescriptor
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
import io.grpc.Status.UNIMPLEMENTED
import io.grpc.StatusException
import io.grpc.kotlin.AbstractCoroutineServerImpl
import io.grpc.kotlin.AbstractCoroutineStub
import io.grpc.kotlin.ClientCalls
import io.grpc.kotlin.ClientCalls.unaryRpc
import io.grpc.kotlin.ServerCalls
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
/**
* Holder for Kotlin coroutine-based client and server APIs for
* cosmos.base.tendermint.v1beta1.Service.
*/
public object ServiceGrpcKt {
public const val SERVICE_NAME: String = ServiceGrpc.SERVICE_NAME
@JvmStatic
public val serviceDescriptor: ServiceDescriptor
get() = ServiceGrpc.getServiceDescriptor()
public val getNodeInfoMethod:
MethodDescriptor
@JvmStatic
get() = ServiceGrpc.getGetNodeInfoMethod()
public val getSyncingMethod: MethodDescriptor
@JvmStatic
get() = ServiceGrpc.getGetSyncingMethod()
public val getLatestBlockMethod:
MethodDescriptor
@JvmStatic
get() = ServiceGrpc.getGetLatestBlockMethod()
public val getBlockByHeightMethod:
MethodDescriptor
@JvmStatic
get() = ServiceGrpc.getGetBlockByHeightMethod()
public val getLatestValidatorSetMethod:
MethodDescriptor
@JvmStatic
get() = ServiceGrpc.getGetLatestValidatorSetMethod()
public val getValidatorSetByHeightMethod:
MethodDescriptor
@JvmStatic
get() = ServiceGrpc.getGetValidatorSetByHeightMethod()
/**
* A stub for issuing RPCs to a(n) cosmos.base.tendermint.v1beta1.Service service as suspending
* coroutines.
*/
@StubFor(ServiceGrpc::class)
public class ServiceCoroutineStub @JvmOverloads constructor(
channel: Channel,
callOptions: CallOptions = DEFAULT,
) : AbstractCoroutineStub(channel, callOptions) {
public override fun build(channel: Channel, callOptions: CallOptions): ServiceCoroutineStub =
ServiceCoroutineStub(channel, callOptions)
/**
* Executes this RPC and returns the response message, suspending until the RPC completes
* with [`Status.OK`][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 getNodeInfo(request: Query.GetNodeInfoRequest, headers: Metadata =
Metadata()): Query.GetNodeInfoResponse = unaryRpc(
channel,
ServiceGrpc.getGetNodeInfoMethod(),
request,
callOptions,
headers
)
/**
* Executes this RPC and returns the response message, suspending until the RPC completes
* with [`Status.OK`][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 getSyncing(request: Query.GetSyncingRequest, headers: Metadata = Metadata()):
Query.GetSyncingResponse = unaryRpc(
channel,
ServiceGrpc.getGetSyncingMethod(),
request,
callOptions,
headers
)
/**
* Executes this RPC and returns the response message, suspending until the RPC completes
* with [`Status.OK`][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 getLatestBlock(request: Query.GetLatestBlockRequest, headers: Metadata =
Metadata()): Query.GetLatestBlockResponse = unaryRpc(
channel,
ServiceGrpc.getGetLatestBlockMethod(),
request,
callOptions,
headers
)
/**
* Executes this RPC and returns the response message, suspending until the RPC completes
* with [`Status.OK`][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 getBlockByHeight(request: Query.GetBlockByHeightRequest, headers: Metadata =
Metadata()): Query.GetBlockByHeightResponse = unaryRpc(
channel,
ServiceGrpc.getGetBlockByHeightMethod(),
request,
callOptions,
headers
)
/**
* Executes this RPC and returns the response message, suspending until the RPC completes
* with [`Status.OK`][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 getLatestValidatorSet(request: Query.GetLatestValidatorSetRequest,
headers: Metadata = Metadata()): Query.GetLatestValidatorSetResponse = unaryRpc(
channel,
ServiceGrpc.getGetLatestValidatorSetMethod(),
request,
callOptions,
headers
)
/**
* Executes this RPC and returns the response message, suspending until the RPC completes
* with [`Status.OK`][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 getValidatorSetByHeight(request: Query.GetValidatorSetByHeightRequest,
headers: Metadata = Metadata()): Query.GetValidatorSetByHeightResponse = unaryRpc(
channel,
ServiceGrpc.getGetValidatorSetByHeightMethod(),
request,
callOptions,
headers
)
}
/**
* Skeletal implementation of the cosmos.base.tendermint.v1beta1.Service service based on Kotlin
* coroutines.
*/
public abstract class ServiceCoroutineImplBase(
coroutineContext: CoroutineContext = EmptyCoroutineContext,
) : AbstractCoroutineServerImpl(coroutineContext) {
/**
* Returns the response to an RPC for cosmos.base.tendermint.v1beta1.Service.GetNodeInfo.
*
* If this method fails with a [StatusException], the RPC will fail with the corresponding
* [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 getNodeInfo(request: Query.GetNodeInfoRequest):
Query.GetNodeInfoResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.base.tendermint.v1beta1.Service.GetNodeInfo is unimplemented"))
/**
* Returns the response to an RPC for cosmos.base.tendermint.v1beta1.Service.GetSyncing.
*
* If this method fails with a [StatusException], the RPC will fail with the corresponding
* [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 getSyncing(request: Query.GetSyncingRequest): Query.GetSyncingResponse =
throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.base.tendermint.v1beta1.Service.GetSyncing is unimplemented"))
/**
* Returns the response to an RPC for cosmos.base.tendermint.v1beta1.Service.GetLatestBlock.
*
* If this method fails with a [StatusException], the RPC will fail with the corresponding
* [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 getLatestBlock(request: Query.GetLatestBlockRequest):
Query.GetLatestBlockResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.base.tendermint.v1beta1.Service.GetLatestBlock is unimplemented"))
/**
* Returns the response to an RPC for cosmos.base.tendermint.v1beta1.Service.GetBlockByHeight.
*
* If this method fails with a [StatusException], the RPC will fail with the corresponding
* [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 getBlockByHeight(request: Query.GetBlockByHeightRequest):
Query.GetBlockByHeightResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.base.tendermint.v1beta1.Service.GetBlockByHeight is unimplemented"))
/**
* Returns the response to an RPC for
* cosmos.base.tendermint.v1beta1.Service.GetLatestValidatorSet.
*
* If this method fails with a [StatusException], the RPC will fail with the corresponding
* [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 getLatestValidatorSet(request: Query.GetLatestValidatorSetRequest):
Query.GetLatestValidatorSetResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.base.tendermint.v1beta1.Service.GetLatestValidatorSet is unimplemented"))
/**
* Returns the response to an RPC for
* cosmos.base.tendermint.v1beta1.Service.GetValidatorSetByHeight.
*
* If this method fails with a [StatusException], the RPC will fail with the corresponding
* [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 getValidatorSetByHeight(request: Query.GetValidatorSetByHeightRequest):
Query.GetValidatorSetByHeightResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.base.tendermint.v1beta1.Service.GetValidatorSetByHeight is unimplemented"))
public final override fun bindService(): ServerServiceDefinition =
builder(getServiceDescriptor())
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = ServiceGrpc.getGetNodeInfoMethod(),
implementation = ::getNodeInfo
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = ServiceGrpc.getGetSyncingMethod(),
implementation = ::getSyncing
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = ServiceGrpc.getGetLatestBlockMethod(),
implementation = ::getLatestBlock
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = ServiceGrpc.getGetBlockByHeightMethod(),
implementation = ::getBlockByHeight
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = ServiceGrpc.getGetLatestValidatorSetMethod(),
implementation = ::getLatestValidatorSet
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = ServiceGrpc.getGetValidatorSetByHeightMethod(),
implementation = ::getValidatorSetByHeight
)).build()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy