cosmos.authz.v1beta1.QueryOuterClassGrpcKt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-kotlin Show documentation
Show all versions of grpc-kotlin Show documentation
Terra Core Protobuf Builds
The newest version!
package cosmos.authz.v1beta1
import cosmos.authz.v1beta1.QueryGrpc.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.authz.v1beta1.Query.
*/
public object QueryGrpcKt {
public const val SERVICE_NAME: String = QueryGrpc.SERVICE_NAME
@JvmStatic
public val serviceDescriptor: ServiceDescriptor
get() = QueryGrpc.getServiceDescriptor()
public val grantsMethod:
MethodDescriptor
@JvmStatic
get() = QueryGrpc.getGrantsMethod()
public val granterGrantsMethod:
MethodDescriptor
@JvmStatic
get() = QueryGrpc.getGranterGrantsMethod()
public val granteeGrantsMethod:
MethodDescriptor
@JvmStatic
get() = QueryGrpc.getGranteeGrantsMethod()
/**
* A stub for issuing RPCs to a(n) cosmos.authz.v1beta1.Query service as suspending coroutines.
*/
@StubFor(QueryGrpc::class)
public class QueryCoroutineStub @JvmOverloads constructor(
channel: Channel,
callOptions: CallOptions = DEFAULT,
) : AbstractCoroutineStub(channel, callOptions) {
public override fun build(channel: Channel, callOptions: CallOptions): QueryCoroutineStub =
QueryCoroutineStub(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 grants(request: QueryOuterClass.QueryGrantsRequest, headers: Metadata =
Metadata()): QueryOuterClass.QueryGrantsResponse = unaryRpc(
channel,
QueryGrpc.getGrantsMethod(),
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 granterGrants(request: QueryOuterClass.QueryGranterGrantsRequest,
headers: Metadata = Metadata()): QueryOuterClass.QueryGranterGrantsResponse = unaryRpc(
channel,
QueryGrpc.getGranterGrantsMethod(),
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 granteeGrants(request: QueryOuterClass.QueryGranteeGrantsRequest,
headers: Metadata = Metadata()): QueryOuterClass.QueryGranteeGrantsResponse = unaryRpc(
channel,
QueryGrpc.getGranteeGrantsMethod(),
request,
callOptions,
headers
)
}
/**
* Skeletal implementation of the cosmos.authz.v1beta1.Query service based on Kotlin coroutines.
*/
public abstract class QueryCoroutineImplBase(
coroutineContext: CoroutineContext = EmptyCoroutineContext,
) : AbstractCoroutineServerImpl(coroutineContext) {
/**
* Returns the response to an RPC for cosmos.authz.v1beta1.Query.Grants.
*
* 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 grants(request: QueryOuterClass.QueryGrantsRequest):
QueryOuterClass.QueryGrantsResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.authz.v1beta1.Query.Grants is unimplemented"))
/**
* Returns the response to an RPC for cosmos.authz.v1beta1.Query.GranterGrants.
*
* 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 granterGrants(request: QueryOuterClass.QueryGranterGrantsRequest):
QueryOuterClass.QueryGranterGrantsResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.authz.v1beta1.Query.GranterGrants is unimplemented"))
/**
* Returns the response to an RPC for cosmos.authz.v1beta1.Query.GranteeGrants.
*
* 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 granteeGrants(request: QueryOuterClass.QueryGranteeGrantsRequest):
QueryOuterClass.QueryGranteeGrantsResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method cosmos.authz.v1beta1.Query.GranteeGrants is unimplemented"))
public final override fun bindService(): ServerServiceDefinition =
builder(getServiceDescriptor())
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = QueryGrpc.getGrantsMethod(),
implementation = ::grants
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = QueryGrpc.getGranterGrantsMethod(),
implementation = ::granterGrants
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = QueryGrpc.getGranteeGrantsMethod(),
implementation = ::granteeGrants
)).build()
}
}