com.google.longrunning.operations.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-common-protos-lite Show documentation
Show all versions of proto-google-common-protos-lite Show documentation
Protobuf compiler and runtime for Kotlin
// Generated by protokt version 0.12.0. Do not modify.
// Source: google/longrunning/operations.proto
package com.google.longrunning
import com.google.rpc.Status
import com.toasttab.protokt.Any
import com.toasttab.protokt.Duration
import com.toasttab.protokt.rt.Int32
import com.toasttab.protokt.rt.KtDeserializer
import com.toasttab.protokt.rt.KtGeneratedMessage
import com.toasttab.protokt.rt.KtMessage
import com.toasttab.protokt.rt.KtMessageDeserializer
import com.toasttab.protokt.rt.KtMessageSerializer
import com.toasttab.protokt.rt.Tag
import com.toasttab.protokt.rt.UnknownFieldSet
import com.toasttab.protokt.rt.copyList
import com.toasttab.protokt.rt.finishList
import com.toasttab.protokt.rt.sizeof
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.MutableList
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
@KtGeneratedMessage("google.longrunning.Operation")
class Operation private constructor(
/**
* The server-assigned name, which is only unique within the same service that originally
* returns it. If you use the default HTTP mapping, the `name` should be a resource name ending
* with `operations/{unique_id}`.
*/
val name: String,
/**
* Service-specific metadata associated with the operation. It typically contains progress
* information and common metadata such as create time. Some services might not provide such
* metadata. Any method that returns a long-running operation should document the metadata type,
* if any.
*/
val metadata: Any?,
/**
* If the value is `false`, it means the operation is still in progress. If `true`, the
* operation is completed, and either `error` or `response` is available.
*/
val done: Boolean,
/**
* The operation result, which can be either an `error` or a valid `response`. If `done` ==
* `false`, neither `error` nor `response` is set. If `done` == `true`, exactly one of `error` or
* `response` is set.
*/
val result: Result?,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result_ = 0
if (name.isNotEmpty()) {
result_ += sizeof(Tag(1)) + sizeof(name)
}
if (metadata != null) {
result_ += sizeof(Tag(2)) + sizeof(metadata)
}
if (done) {
result_ += sizeof(Tag(3)) + sizeof(done)
}
when (result) {
is Operation.Result.Error -> {
result_ += sizeof(Tag(4)) + sizeof(result.error)}
is Operation.Result.Response -> {
result_ += sizeof(Tag(5)) + sizeof(result.response)}
null -> Unit
}
result_ += unknownFields.size()
return result_
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.write(Tag(10)).write(name)
}
if (metadata != null) {
serializer.write(Tag(18)).write(metadata)
}
if (done) {
serializer.write(Tag(24)).write(done)
}
when (result) {
is Operation.Result.Error -> {
serializer.write(Tag(34)).write(result.error)
}
is Operation.Result.Response -> {
serializer.write(Tag(42)).write(result.response)
}
null -> Unit
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is Operation &&
other.name == name &&
other.metadata == metadata &&
other.done == done &&
other.result == result &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + name.hashCode()
result = 31 * result + metadata.hashCode()
result = 31 * result + done.hashCode()
result = 31 * result + result.hashCode()
return result
}
override fun toString(): String = "Operation(" +
"name=$name, " +
"metadata=$metadata, " +
"done=$done, " +
"result=$result" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: OperationDsl.() -> Unit): Operation = Operation.Deserializer {
name = [email protected]
metadata = [email protected]
done = [email protected]
result = [email protected]
unknownFields = [email protected]
dsl()
}
sealed class Result {
/**
* The error result of the operation in case of failure or cancellation.
*/
data class Error(
val error: Status,
) : Result()
/**
* The normal response of the operation in case of success. If the original method returns
* no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the
* original method is standard `Get`/`Create`/`Update`, the response should be the resource.
* For other methods, the response should have the type `XxxResponse`, where `Xxx` is the
* original method name. For example, if the original method name is `TakeSnapshot()`, the
* inferred response type is `TakeSnapshotResponse`.
*/
data class Response(
val response: Any,
) : Result()
}
class OperationDsl {
var name: String = ""
var metadata: Any? = null
var done: Boolean = false
var result: Result? = null
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): Operation = Operation(name,
metadata,
done,
result,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(OperationDsl.() -> Unit) -> Operation {
override fun deserialize(deserializer: KtMessageDeserializer): Operation {
var name = ""
var metadata : Any? = null
var done = false
var result : Result? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return Operation(name,
metadata,
done,
result,
UnknownFieldSet.from(unknownFields))
10 -> name = deserializer.readString()
18 -> metadata = deserializer.readMessage(com.toasttab.protokt.Any)
24 -> done = deserializer.readBool()
34 -> result = Result.Error(deserializer.readMessage(com.google.rpc.Status))
42 -> result =
Result.Response(deserializer.readMessage(com.toasttab.protokt.Any))
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: OperationDsl.() -> Unit): Operation =
OperationDsl().apply(dsl).build()
}
}
/**
* The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
*/
@KtGeneratedMessage("google.longrunning.GetOperationRequest")
class GetOperationRequest private constructor(
/**
* The name of the operation resource.
*/
val name: String,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeof(Tag(1)) + sizeof(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.write(Tag(10)).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is GetOperationRequest &&
other.name == name &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + name.hashCode()
return result
}
override fun toString(): String = "GetOperationRequest(" +
"name=$name" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: GetOperationRequestDsl.() -> Unit): GetOperationRequest =
GetOperationRequest.Deserializer {
name = [email protected]
unknownFields = [email protected]
dsl()
}
class GetOperationRequestDsl {
var name: String = ""
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): GetOperationRequest = GetOperationRequest(name,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(GetOperationRequestDsl.() -> Unit) -> GetOperationRequest {
override fun deserialize(deserializer: KtMessageDeserializer): GetOperationRequest {
var name = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return GetOperationRequest(name,
UnknownFieldSet.from(unknownFields))
10 -> name = deserializer.readString()
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: GetOperationRequestDsl.() -> Unit): GetOperationRequest =
GetOperationRequestDsl().apply(dsl).build()
}
}
/**
* The request message for
* [Operations.ListOperations][google.longrunning.Operations.ListOperations].
*/
@KtGeneratedMessage("google.longrunning.ListOperationsRequest")
class ListOperationsRequest private constructor(
/**
* The standard list filter.
*/
val filter: String,
/**
* The standard list page size.
*/
val pageSize: Int,
/**
* The standard list page token.
*/
val pageToken: String,
/**
* The name of the operation's parent resource.
*/
val name: String,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (filter.isNotEmpty()) {
result += sizeof(Tag(1)) + sizeof(filter)
}
if (pageSize != 0) {
result += sizeof(Tag(2)) + sizeof(Int32(pageSize))
}
if (pageToken.isNotEmpty()) {
result += sizeof(Tag(3)) + sizeof(pageToken)
}
if (name.isNotEmpty()) {
result += sizeof(Tag(4)) + sizeof(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (filter.isNotEmpty()) {
serializer.write(Tag(10)).write(filter)
}
if (pageSize != 0) {
serializer.write(Tag(16)).write(Int32(pageSize))
}
if (pageToken.isNotEmpty()) {
serializer.write(Tag(26)).write(pageToken)
}
if (name.isNotEmpty()) {
serializer.write(Tag(34)).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is ListOperationsRequest &&
other.filter == filter &&
other.pageSize == pageSize &&
other.pageToken == pageToken &&
other.name == name &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + filter.hashCode()
result = 31 * result + pageSize.hashCode()
result = 31 * result + pageToken.hashCode()
result = 31 * result + name.hashCode()
return result
}
override fun toString(): String = "ListOperationsRequest(" +
"filter=$filter, " +
"pageSize=$pageSize, " +
"pageToken=$pageToken, " +
"name=$name" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: ListOperationsRequestDsl.() -> Unit): ListOperationsRequest =
ListOperationsRequest.Deserializer {
filter = [email protected]
pageSize = [email protected]
pageToken = [email protected]
name = [email protected]
unknownFields = [email protected]
dsl()
}
class ListOperationsRequestDsl {
var filter: String = ""
var pageSize: Int = 0
var pageToken: String = ""
var name: String = ""
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): ListOperationsRequest = ListOperationsRequest(filter,
pageSize,
pageToken,
name,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(ListOperationsRequestDsl.() -> Unit) -> ListOperationsRequest {
override fun deserialize(deserializer: KtMessageDeserializer):
ListOperationsRequest {
var filter = ""
var pageSize = 0
var pageToken = ""
var name = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return ListOperationsRequest(filter,
pageSize,
pageToken,
name,
UnknownFieldSet.from(unknownFields))
10 -> filter = deserializer.readString()
16 -> pageSize = deserializer.readInt32()
26 -> pageToken = deserializer.readString()
34 -> name = deserializer.readString()
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: ListOperationsRequestDsl.() -> Unit): ListOperationsRequest
= ListOperationsRequestDsl().apply(dsl).build()
}
}
/**
* The response message for
* [Operations.ListOperations][google.longrunning.Operations.ListOperations].
*/
@KtGeneratedMessage("google.longrunning.ListOperationsResponse")
class ListOperationsResponse private constructor(
/**
* A list of operations that matches the specified filter in the request.
*/
val operations: List,
/**
* The standard List next-page token.
*/
val nextPageToken: String,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (operations.isNotEmpty()) {
result += (sizeof(Tag(1)) * operations.size) + operations.sumOf { sizeof(it) }
}
if (nextPageToken.isNotEmpty()) {
result += sizeof(Tag(2)) + sizeof(nextPageToken)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (operations.isNotEmpty()) {
operations.forEach { serializer.write(Tag(10)).write(it) }
}
if (nextPageToken.isNotEmpty()) {
serializer.write(Tag(18)).write(nextPageToken)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is ListOperationsResponse &&
other.operations == operations &&
other.nextPageToken == nextPageToken &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + operations.hashCode()
result = 31 * result + nextPageToken.hashCode()
return result
}
override fun toString(): String = "ListOperationsResponse(" +
"operations=$operations, " +
"nextPageToken=$nextPageToken" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: ListOperationsResponseDsl.() -> Unit): ListOperationsResponse =
ListOperationsResponse.Deserializer {
operations = [email protected]
nextPageToken = [email protected]
unknownFields = [email protected]
dsl()
}
class ListOperationsResponseDsl {
var operations: List = emptyList()
set(newValue) {
field = copyList(newValue)
}
var nextPageToken: String = ""
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): ListOperationsResponse = ListOperationsResponse(finishList(operations),
nextPageToken,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(ListOperationsResponseDsl.() -> Unit) -> ListOperationsResponse {
override fun deserialize(deserializer: KtMessageDeserializer):
ListOperationsResponse {
var operations : MutableList? = null
var nextPageToken = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return ListOperationsResponse(finishList(operations),
nextPageToken,
UnknownFieldSet.from(unknownFields))
10 -> operations = (operations ?: mutableListOf()).apply {
deserializer.readRepeated(false) {
add(deserializer.readMessage(com.google.longrunning.Operation))
}
}
18 -> nextPageToken = deserializer.readString()
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: ListOperationsResponseDsl.() -> Unit):
ListOperationsResponse = ListOperationsResponseDsl().apply(dsl).build()
}
}
/**
* The request message for
* [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
*/
@KtGeneratedMessage("google.longrunning.CancelOperationRequest")
class CancelOperationRequest private constructor(
/**
* The name of the operation resource to be cancelled.
*/
val name: String,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeof(Tag(1)) + sizeof(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.write(Tag(10)).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is CancelOperationRequest &&
other.name == name &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + name.hashCode()
return result
}
override fun toString(): String = "CancelOperationRequest(" +
"name=$name" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: CancelOperationRequestDsl.() -> Unit): CancelOperationRequest =
CancelOperationRequest.Deserializer {
name = [email protected]
unknownFields = [email protected]
dsl()
}
class CancelOperationRequestDsl {
var name: String = ""
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): CancelOperationRequest = CancelOperationRequest(name,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(CancelOperationRequestDsl.() -> Unit) -> CancelOperationRequest {
override fun deserialize(deserializer: KtMessageDeserializer):
CancelOperationRequest {
var name = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return CancelOperationRequest(name,
UnknownFieldSet.from(unknownFields))
10 -> name = deserializer.readString()
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: CancelOperationRequestDsl.() -> Unit):
CancelOperationRequest = CancelOperationRequestDsl().apply(dsl).build()
}
}
/**
* The request message for
* [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
*/
@KtGeneratedMessage("google.longrunning.DeleteOperationRequest")
class DeleteOperationRequest private constructor(
/**
* The name of the operation resource to be deleted.
*/
val name: String,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeof(Tag(1)) + sizeof(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.write(Tag(10)).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is DeleteOperationRequest &&
other.name == name &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + name.hashCode()
return result
}
override fun toString(): String = "DeleteOperationRequest(" +
"name=$name" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: DeleteOperationRequestDsl.() -> Unit): DeleteOperationRequest =
DeleteOperationRequest.Deserializer {
name = [email protected]
unknownFields = [email protected]
dsl()
}
class DeleteOperationRequestDsl {
var name: String = ""
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): DeleteOperationRequest = DeleteOperationRequest(name,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(DeleteOperationRequestDsl.() -> Unit) -> DeleteOperationRequest {
override fun deserialize(deserializer: KtMessageDeserializer):
DeleteOperationRequest {
var name = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return DeleteOperationRequest(name,
UnknownFieldSet.from(unknownFields))
10 -> name = deserializer.readString()
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: DeleteOperationRequestDsl.() -> Unit):
DeleteOperationRequest = DeleteOperationRequestDsl().apply(dsl).build()
}
}
/**
* The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
*/
@KtGeneratedMessage("google.longrunning.WaitOperationRequest")
class WaitOperationRequest private constructor(
/**
* The name of the operation resource to wait on.
*/
val name: String,
/**
* The maximum duration to wait before timing out. If left blank, the wait will be at most the
* time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified,
* the shorter one will be used.
*/
val timeout: Duration?,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeof(Tag(1)) + sizeof(name)
}
if (timeout != null) {
result += sizeof(Tag(2)) + sizeof(timeout)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.write(Tag(10)).write(name)
}
if (timeout != null) {
serializer.write(Tag(18)).write(timeout)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is WaitOperationRequest &&
other.name == name &&
other.timeout == timeout &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + name.hashCode()
result = 31 * result + timeout.hashCode()
return result
}
override fun toString(): String = "WaitOperationRequest(" +
"name=$name, " +
"timeout=$timeout" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: WaitOperationRequestDsl.() -> Unit): WaitOperationRequest =
WaitOperationRequest.Deserializer {
name = [email protected]
timeout = [email protected]
unknownFields = [email protected]
dsl()
}
class WaitOperationRequestDsl {
var name: String = ""
var timeout: Duration? = null
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): WaitOperationRequest = WaitOperationRequest(name,
timeout,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(WaitOperationRequestDsl.() -> Unit) -> WaitOperationRequest {
override fun deserialize(deserializer: KtMessageDeserializer): WaitOperationRequest {
var name = ""
var timeout : Duration? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return WaitOperationRequest(name,
timeout,
UnknownFieldSet.from(unknownFields))
10 -> name = deserializer.readString()
18 -> timeout = deserializer.readMessage(com.toasttab.protokt.Duration)
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: WaitOperationRequestDsl.() -> Unit): WaitOperationRequest =
WaitOperationRequestDsl().apply(dsl).build()
}
}
/**
* A message representing the message types used by a long-running operation.
*
* Example:
*
* rpc LongRunningRecognize(LongRunningRecognizeRequest) returns
* (google.longrunning.Operation) { option (google.longrunning.operation_info) = {
* response_type: "LongRunningRecognizeResponse" metadata_type: "LongRunningRecognizeMetadata"
* }; }
*/
@KtGeneratedMessage("google.longrunning.OperationInfo")
class OperationInfo private constructor(
/**
* Required. The message name of the primary return type for this long-running operation. This
* type will be used to deserialize the LRO's response.
*
* If the response is in a different package from the rpc, a fully-qualified message name must
* be used (e.g. `google.protobuf.Struct`).
*
* Note: Altering this value constitutes a breaking change.
*/
val responseType: String,
/**
* Required. The message name of the metadata type for this long-running operation.
*
* If the response is in a different package from the rpc, a fully-qualified message name must
* be used (e.g. `google.protobuf.Struct`).
*
* Note: Altering this value constitutes a breaking change.
*/
val metadataType: String,
val unknownFields: UnknownFieldSet = UnknownFieldSet.empty(),
) : KtMessage {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (responseType.isNotEmpty()) {
result += sizeof(Tag(1)) + sizeof(responseType)
}
if (metadataType.isNotEmpty()) {
result += sizeof(Tag(2)) + sizeof(metadataType)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (responseType.isNotEmpty()) {
serializer.write(Tag(10)).write(responseType)
}
if (metadataType.isNotEmpty()) {
serializer.write(Tag(18)).write(metadataType)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: kotlin.Any?): Boolean = other is OperationInfo &&
other.responseType == responseType &&
other.metadataType == metadataType &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + responseType.hashCode()
result = 31 * result + metadataType.hashCode()
return result
}
override fun toString(): String = "OperationInfo(" +
"responseType=$responseType, " +
"metadataType=$metadataType" +
"${if (unknownFields.isEmpty()) "" else ", unknownFields=$unknownFields"})"
fun copy(dsl: OperationInfoDsl.() -> Unit): OperationInfo = OperationInfo.Deserializer {
responseType = [email protected]
metadataType = [email protected]
unknownFields = [email protected]
dsl()
}
class OperationInfoDsl {
var responseType: String = ""
var metadataType: String = ""
var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
fun build(): OperationInfo = OperationInfo(responseType,
metadataType,
unknownFields)
}
companion object Deserializer : KtDeserializer,
(OperationInfoDsl.() -> Unit) -> OperationInfo {
override fun deserialize(deserializer: KtMessageDeserializer): OperationInfo {
var responseType = ""
var metadataType = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when(deserializer.readTag()) {
0 -> return OperationInfo(responseType,
metadataType,
UnknownFieldSet.from(unknownFields))
10 -> responseType = deserializer.readString()
18 -> metadataType = deserializer.readString()
else -> unknownFields = (unknownFields ?:
UnknownFieldSet.Builder()).also {it.add(deserializer.readUnknown()) }
}
}
}
override fun invoke(dsl: OperationInfoDsl.() -> Unit): OperationInfo =
OperationInfoDsl().apply(dsl).build()
}
}