grpc.webhook.WebhookOuterClassGrpcKt.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.webhook
import grpc.webhook.WebhookGrpc.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 webhook.Webhook.
*/
public object WebhookGrpcKt {
public const val SERVICE_NAME: String = WebhookGrpc.SERVICE_NAME
@JvmStatic
public val serviceDescriptor: ServiceDescriptor
get() = getServiceDescriptor()
public val putWebhookMethod: MethodDescriptor<_PutWebhookRequest, _PutWebhookResponse>
@JvmStatic
get() = WebhookGrpc.getPutWebhookMethod()
public val deleteWebhookMethod: MethodDescriptor<_DeleteWebhookRequest, _DeleteWebhookResponse>
@JvmStatic
get() = WebhookGrpc.getDeleteWebhookMethod()
public val listWebhooksMethod: MethodDescriptor<_ListWebhookRequest, _ListWebhooksResponse>
@JvmStatic
get() = WebhookGrpc.getListWebhooksMethod()
public val getWebhookSecretMethod:
MethodDescriptor<_GetWebhookSecretRequest, _GetWebhookSecretResponse>
@JvmStatic
get() = WebhookGrpc.getGetWebhookSecretMethod()
public val rotateWebhookSecretMethod:
MethodDescriptor<_RotateWebhookSecretRequest, _RotateWebhookSecretResponse>
@JvmStatic
get() = WebhookGrpc.getRotateWebhookSecretMethod()
/**
* A stub for issuing RPCs to a(n) webhook.Webhook service as suspending coroutines.
*/
@StubFor(WebhookGrpc::class)
public class WebhookCoroutineStub @JvmOverloads constructor(
channel: Channel,
callOptions: CallOptions = DEFAULT,
) : AbstractCoroutineStub(channel, callOptions) {
override fun build(channel: Channel, callOptions: CallOptions): WebhookCoroutineStub =
WebhookCoroutineStub(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 putWebhook(request: _PutWebhookRequest, headers: Metadata = Metadata()):
_PutWebhookResponse = unaryRpc(
channel,
WebhookGrpc.getPutWebhookMethod(),
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 deleteWebhook(request: _DeleteWebhookRequest, headers: Metadata =
Metadata()): _DeleteWebhookResponse = unaryRpc(
channel,
WebhookGrpc.getDeleteWebhookMethod(),
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 listWebhooks(request: _ListWebhookRequest, headers: Metadata = Metadata()):
_ListWebhooksResponse = unaryRpc(
channel,
WebhookGrpc.getListWebhooksMethod(),
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 getWebhookSecret(request: _GetWebhookSecretRequest, headers: Metadata =
Metadata()): _GetWebhookSecretResponse = unaryRpc(
channel,
WebhookGrpc.getGetWebhookSecretMethod(),
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 rotateWebhookSecret(request: _RotateWebhookSecretRequest, headers: Metadata =
Metadata()): _RotateWebhookSecretResponse = unaryRpc(
channel,
WebhookGrpc.getRotateWebhookSecretMethod(),
request,
callOptions,
headers
)
}
/**
* Skeletal implementation of the webhook.Webhook service based on Kotlin coroutines.
*/
public abstract class WebhookCoroutineImplBase(
coroutineContext: CoroutineContext = EmptyCoroutineContext,
) : AbstractCoroutineServerImpl(coroutineContext) {
/**
* Returns the response to an RPC for webhook.Webhook.PutWebhook.
*
* 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 putWebhook(request: _PutWebhookRequest): _PutWebhookResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method webhook.Webhook.PutWebhook is unimplemented"))
/**
* Returns the response to an RPC for webhook.Webhook.DeleteWebhook.
*
* 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 deleteWebhook(request: _DeleteWebhookRequest): _DeleteWebhookResponse =
throw
StatusException(UNIMPLEMENTED.withDescription("Method webhook.Webhook.DeleteWebhook is unimplemented"))
/**
* Returns the response to an RPC for webhook.Webhook.ListWebhooks.
*
* 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 listWebhooks(request: _ListWebhookRequest): _ListWebhooksResponse =
throw
StatusException(UNIMPLEMENTED.withDescription("Method webhook.Webhook.ListWebhooks is unimplemented"))
/**
* Returns the response to an RPC for webhook.Webhook.GetWebhookSecret.
*
* 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 getWebhookSecret(request: _GetWebhookSecretRequest):
_GetWebhookSecretResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method webhook.Webhook.GetWebhookSecret is unimplemented"))
/**
* Returns the response to an RPC for webhook.Webhook.RotateWebhookSecret.
*
* 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 rotateWebhookSecret(request: _RotateWebhookSecretRequest):
_RotateWebhookSecretResponse = throw
StatusException(UNIMPLEMENTED.withDescription("Method webhook.Webhook.RotateWebhookSecret is unimplemented"))
final override fun bindService(): ServerServiceDefinition = builder(getServiceDescriptor())
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = WebhookGrpc.getPutWebhookMethod(),
implementation = ::putWebhook
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = WebhookGrpc.getDeleteWebhookMethod(),
implementation = ::deleteWebhook
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = WebhookGrpc.getListWebhooksMethod(),
implementation = ::listWebhooks
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = WebhookGrpc.getGetWebhookSecretMethod(),
implementation = ::getWebhookSecret
))
.addMethod(unaryServerMethodDefinition(
context = this.context,
descriptor = WebhookGrpc.getRotateWebhookSecretMethod(),
implementation = ::rotateWebhookSecret
)).build()
}
}