grpc.leaderboard.LeaderboardOuterClassGrpcKt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client-protos-jvm Show documentation
Show all versions of client-protos-jvm Show documentation
Kotlin protobuf protocols for the JVM that define the Momento gRPC wire format
package grpc.leaderboard
import grpc.common._Empty
import grpc.leaderboard.LeaderboardGrpc.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.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
/**
* Holder for Kotlin coroutine-based client and server APIs for leaderboard.Leaderboard.
*/
public object LeaderboardGrpcKt {
public const val SERVICE_NAME: String = LeaderboardGrpc.SERVICE_NAME
@JvmStatic
public val serviceDescriptor: ServiceDescriptor
get() = getServiceDescriptor()
public val deleteLeaderboardMethod: MethodDescriptor<_DeleteLeaderboardRequest, _Empty>
@JvmStatic
get() = LeaderboardGrpc.getDeleteLeaderboardMethod()
public val upsertElementsMethod: MethodDescriptor<_UpsertElementsRequest, _Empty>
@JvmStatic
get() = LeaderboardGrpc.getUpsertElementsMethod()
public val removeElementsMethod: MethodDescriptor<_RemoveElementsRequest, _Empty>
@JvmStatic
get() = LeaderboardGrpc.getRemoveElementsMethod()
public val getLeaderboardLengthMethod:
MethodDescriptor<_GetLeaderboardLengthRequest, _GetLeaderboardLengthResponse>
@JvmStatic
get() = LeaderboardGrpc.getGetLeaderboardLengthMethod()
public val getByRankMethod: MethodDescriptor<_GetByRankRequest, _GetByRankResponse>
@JvmStatic
get() = LeaderboardGrpc.getGetByRankMethod()
public val getRankMethod: MethodDescriptor<_GetRankRequest, _GetRankResponse>
@JvmStatic
get() = LeaderboardGrpc.getGetRankMethod()
public val getByScoreMethod: MethodDescriptor<_GetByScoreRequest, _GetByScoreResponse>
@JvmStatic
get() = LeaderboardGrpc.getGetByScoreMethod()
/**
* A stub for issuing RPCs to a(n) leaderboard.Leaderboard service as suspending coroutines.
*/
@StubFor(LeaderboardGrpc::class)
public class LeaderboardCoroutineStub @JvmOverloads constructor(
channel: Channel,
callOptions: CallOptions = DEFAULT,
) : AbstractCoroutineStub(channel, callOptions) {
override fun build(channel: Channel, callOptions: CallOptions): LeaderboardCoroutineStub =
LeaderboardCoroutineStub(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 deleteLeaderboard(request: _DeleteLeaderboardRequest, headers: Metadata =
Metadata()): _Empty = unaryRpc(
channel,
LeaderboardGrpc.getDeleteLeaderboardMethod(),
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 upsertElements(request: _UpsertElementsRequest, headers: Metadata =
Metadata()): _Empty = unaryRpc(
channel,
LeaderboardGrpc.getUpsertElementsMethod(),
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 removeElements(request: _RemoveElementsRequest, headers: Metadata =
Metadata()): _Empty = unaryRpc(
channel,
LeaderboardGrpc.getRemoveElementsMethod(),
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 getLeaderboardLength(request: _GetLeaderboardLengthRequest, headers: Metadata
= Metadata()): _GetLeaderboardLengthResponse = unaryRpc(
channel,
LeaderboardGrpc.getGetLeaderboardLengthMethod(),
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 getByRank(request: _GetByRankRequest, headers: Metadata = Metadata()):
_GetByRankResponse = unaryRpc(
channel,
LeaderboardGrpc.getGetByRankMethod(),
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 getRank(request: _GetRankRequest, headers: Metadata = Metadata()):
_GetRankResponse = unaryRpc(
channel,
LeaderboardGrpc.getGetRankMethod(),
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 getByScore(request: _GetByScoreRequest, headers: Metadata = Metadata()):
_GetByScoreResponse = unaryRpc(
channel,
LeaderboardGrpc.getGetByScoreMethod(),
request,
callOptions,
headers
)
}
/**
* Skeletal implementation of the leaderboard.Leaderboard service based on Kotlin coroutines.
*/
public abstract class LeaderboardCoroutineImplBase(
coroutineContext: CoroutineContext = EmptyCoroutineContext,
) : AbstractCoroutineServerImpl(coroutineContext) {
/**
* Returns the response to an RPC for leaderboard.Leaderboard.DeleteLeaderboard.
*
* 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 deleteLeaderboard(request: _DeleteLeaderboardRequest): _Empty = throw
StatusException(UNIMPLEMENTED.withDescription("Method leaderboard.Leaderboard.DeleteLeaderboard is unimplemented"))
/**
* Returns the response to an RPC for leaderboard.Leaderboard.UpsertElements.
*
* 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 upsertElements(request: _UpsertElementsRequest): _Empty = throw
StatusException(UNIMPLEMENTED.withDescription("Method leaderboard.Leaderboard.UpsertElements is unimplemented"))
/**
* Returns the response to an RPC for leaderboard.Leaderboard.RemoveElements.
*
* 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 removeElements(request: _RemoveElementsRequest): _Empty = throw
StatusException(UNIMPLEMENTED.withDescription("Method leaderboard.Leaderboard.RemoveElements is unimplemented"))
/**
* Returns the response to an RPC for leaderboard.Leaderboard.GetLeaderboardLength.
*
* 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 getLeaderboardLength(request: _GetLeaderboardLengthRequest):
_GetLeaderboardLengthResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method leaderboard.Leaderboard.GetLeaderboardLength is unimplemented"))
/**
* Returns the response to an RPC for leaderboard.Leaderboard.GetByRank.
*
* 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 getByRank(request: _GetByRankRequest): _GetByRankResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method leaderboard.Leaderboard.GetByRank is unimplemented"))
/**
* Returns the response to an RPC for leaderboard.Leaderboard.GetRank.
*
* 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 getRank(request: _GetRankRequest): _GetRankResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method leaderboard.Leaderboard.GetRank is unimplemented"))
/**
* Returns the response to an RPC for leaderboard.Leaderboard.GetByScore.
*
* 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 getByScore(request: _GetByScoreRequest): _GetByScoreResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method leaderboard.Leaderboard.GetByScore is unimplemented"))
final override fun bindService(): ServerServiceDefinition = builder(getServiceDescriptor())
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = LeaderboardGrpc.getDeleteLeaderboardMethod(),
implementation = ::deleteLeaderboard
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = LeaderboardGrpc.getUpsertElementsMethod(),
implementation = ::upsertElements
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = LeaderboardGrpc.getRemoveElementsMethod(),
implementation = ::removeElements
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = LeaderboardGrpc.getGetLeaderboardLengthMethod(),
implementation = ::getLeaderboardLength
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = LeaderboardGrpc.getGetByRankMethod(),
implementation = ::getByRank
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = LeaderboardGrpc.getGetRankMethod(),
implementation = ::getRank
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = LeaderboardGrpc.getGetByScoreMethod(),
implementation = ::getByScore
)).build()
}
}