Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by protokt version 1.0.0-alpha.8. Do not modify.
// Source: google/longrunning/operations.proto
@file:Suppress("DEPRECATION")
package protokt.v1.google.longrunning
import protokt.v1.AbstractKtDeserializer
import protokt.v1.AbstractKtMessage
import protokt.v1.Collections.copyList
import protokt.v1.Collections.unmodifiableList
import protokt.v1.KtBuilderDsl
import protokt.v1.KtMessageDeserializer
import protokt.v1.KtMessageSerializer
import protokt.v1.SizeCodecs.sizeOf
import protokt.v1.UnknownFieldSet
import protokt.v1.google.protobuf.Duration
import protokt.v1.google.rpc.Status
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.MutableList
import kotlin.jvm.JvmStatic
import com.toasttab.protokt.rt.KtGeneratedMessage as RtKtGeneratedMessage
import kotlin.Any as KotlinAny
import protokt.v1.KtGeneratedMessage as V1KtGeneratedMessage
import protokt.v1.google.protobuf.Any as ProtobufAny
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
@V1KtGeneratedMessage("google.longrunning.Operation")
@RtKtGeneratedMessage("google.longrunning.Operation")
public 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}`.
*/
public 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.
*/
public val metadata: ProtobufAny?,
/**
* 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.
*/
public 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.
*/
public val result: Result?,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result_ = 0
if (name.isNotEmpty()) {
result_ += sizeOf(10u) + sizeOf(name)
}
if (metadata != null) {
result_ += sizeOf(18u) + sizeOf(metadata)
}
if (done) {
result_ += sizeOf(24u) + 1
}
when (result) {
is Result.Error ->
result_ += sizeOf(34u) + sizeOf(result.error)
is Result.Response ->
result_ += sizeOf(42u) + sizeOf(result.response)
null -> Unit
}
result_ += unknownFields.size()
return result_
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.writeTag(10u).write(name)
}
if (metadata != null) {
serializer.writeTag(18u).write(metadata)
}
if (done) {
serializer.writeTag(24u).write(done)
}
when (result) {
is Result.Error ->
serializer.writeTag(34u).write(result.error)
is Result.Response ->
serializer.writeTag(42u).write(result.response)
null -> Unit
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): Operation =
Builder().apply {
name = [email protected]
metadata = [email protected]
done = [email protected]
result = [email protected]
unknownFields = [email protected]
builder()
}.build()
public sealed class Result {
/**
* The error result of the operation in case of failure or cancellation.
*/
public data class Error(
public 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`.
*/
public data class Response(
public val response: ProtobufAny
) : Result()
}
@KtBuilderDsl
public class Builder {
public var name: String = ""
public var metadata: ProtobufAny? = null
public var done: Boolean = false
public var result: Result? = null
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): Operation =
Operation(
name,
metadata,
done,
result,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): Operation {
var name = ""
var metadata: ProtobufAny? = 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(ProtobufAny)
24 -> done = deserializer.readBool()
34 -> result = Result.Error(deserializer.readMessage(Status))
42 -> result = Result.Response(deserializer.readMessage(ProtobufAny))
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): Operation = Builder().apply(dsl).build()
}
}
/**
* The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
*/
@V1KtGeneratedMessage("google.longrunning.GetOperationRequest")
@RtKtGeneratedMessage("google.longrunning.GetOperationRequest")
public class GetOperationRequest private constructor(
/**
* The name of the operation resource.
*/
public val name: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.writeTag(10u).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): GetOperationRequest =
Builder().apply {
name = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var name: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): GetOperationRequest =
GetOperationRequest(
name,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
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())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): GetOperationRequest = Builder().apply(dsl).build()
}
}
/**
* The request message for
* [Operations.ListOperations][google.longrunning.Operations.ListOperations].
*/
@V1KtGeneratedMessage("google.longrunning.ListOperationsRequest")
@RtKtGeneratedMessage("google.longrunning.ListOperationsRequest")
public class ListOperationsRequest private constructor(
/**
* The standard list filter.
*/
public val filter: String,
/**
* The standard list page size.
*/
public val pageSize: Int,
/**
* The standard list page token.
*/
public val pageToken: String,
/**
* The name of the operation's parent resource.
*/
public val name: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (filter.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(filter)
}
if (pageSize != 0) {
result += sizeOf(16u) + sizeOf(pageSize)
}
if (pageToken.isNotEmpty()) {
result += sizeOf(26u) + sizeOf(pageToken)
}
if (name.isNotEmpty()) {
result += sizeOf(34u) + sizeOf(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (filter.isNotEmpty()) {
serializer.writeTag(10u).write(filter)
}
if (pageSize != 0) {
serializer.writeTag(16u).write(pageSize)
}
if (pageToken.isNotEmpty()) {
serializer.writeTag(26u).write(pageToken)
}
if (name.isNotEmpty()) {
serializer.writeTag(34u).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): ListOperationsRequest =
Builder().apply {
filter = [email protected]
pageSize = [email protected]
pageToken = [email protected]
name = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var filter: String = ""
public var pageSize: Int = 0
public var pageToken: String = ""
public var name: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): ListOperationsRequest =
ListOperationsRequest(
filter,
pageSize,
pageToken,
name,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
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())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): ListOperationsRequest = Builder().apply(dsl).build()
}
}
/**
* The response message for
* [Operations.ListOperations][google.longrunning.Operations.ListOperations].
*/
@V1KtGeneratedMessage("google.longrunning.ListOperationsResponse")
@RtKtGeneratedMessage("google.longrunning.ListOperationsResponse")
public class ListOperationsResponse private constructor(
/**
* A list of operations that matches the specified filter in the request.
*/
public val operations: List,
/**
* The standard List next-page token.
*/
public val nextPageToken: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (operations.isNotEmpty()) {
result += (sizeOf(10u) * operations.size) + operations.sumOf { sizeOf(it) }
}
if (nextPageToken.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(nextPageToken)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
operations.forEach { serializer.writeTag(10u).write(it) }
if (nextPageToken.isNotEmpty()) {
serializer.writeTag(18u).write(nextPageToken)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): ListOperationsResponse =
Builder().apply {
operations = [email protected]
nextPageToken = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var operations: List = emptyList()
set(newValue) {
field = copyList(newValue)
}
public var nextPageToken: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): ListOperationsResponse =
ListOperationsResponse(
unmodifiableList(operations),
nextPageToken,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
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(
unmodifiableList(operations),
nextPageToken,
UnknownFieldSet.from(unknownFields)
)
10 ->
operations =
(operations ?: mutableListOf()).apply {
deserializer.readRepeated(false) {
add(deserializer.readMessage(Operation))
}
}
18 -> nextPageToken = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): ListOperationsResponse = Builder().apply(dsl).build()
}
}
/**
* The request message for
* [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
*/
@V1KtGeneratedMessage("google.longrunning.CancelOperationRequest")
@RtKtGeneratedMessage("google.longrunning.CancelOperationRequest")
public class CancelOperationRequest private constructor(
/**
* The name of the operation resource to be cancelled.
*/
public val name: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.writeTag(10u).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): CancelOperationRequest =
Builder().apply {
name = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var name: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): CancelOperationRequest =
CancelOperationRequest(
name,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
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())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): CancelOperationRequest = Builder().apply(dsl).build()
}
}
/**
* The request message for
* [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
*/
@V1KtGeneratedMessage("google.longrunning.DeleteOperationRequest")
@RtKtGeneratedMessage("google.longrunning.DeleteOperationRequest")
public class DeleteOperationRequest private constructor(
/**
* The name of the operation resource to be deleted.
*/
public val name: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(name)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.writeTag(10u).write(name)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): DeleteOperationRequest =
Builder().apply {
name = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var name: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): DeleteOperationRequest =
DeleteOperationRequest(
name,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
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())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): DeleteOperationRequest = Builder().apply(dsl).build()
}
}
/**
* The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
*/
@V1KtGeneratedMessage("google.longrunning.WaitOperationRequest")
@RtKtGeneratedMessage("google.longrunning.WaitOperationRequest")
public class WaitOperationRequest private constructor(
/**
* The name of the operation resource to wait on.
*/
public 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.
*/
public val timeout: Duration?,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (name.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(name)
}
if (timeout != null) {
result += sizeOf(18u) + sizeOf(timeout)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (name.isNotEmpty()) {
serializer.writeTag(10u).write(name)
}
if (timeout != null) {
serializer.writeTag(18u).write(timeout)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): WaitOperationRequest =
Builder().apply {
name = [email protected]
timeout = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var name: String = ""
public var timeout: Duration? = null
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): WaitOperationRequest =
WaitOperationRequest(
name,
timeout,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
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(Duration)
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): WaitOperationRequest = Builder().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"
* }; }
*/
@V1KtGeneratedMessage("google.longrunning.OperationInfo")
@RtKtGeneratedMessage("google.longrunning.OperationInfo")
public 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.
*/
public 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.
*/
public val metadataType: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (responseType.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(responseType)
}
if (metadataType.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(metadataType)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (responseType.isNotEmpty()) {
serializer.writeTag(10u).write(responseType)
}
if (metadataType.isNotEmpty()) {
serializer.writeTag(18u).write(metadataType)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: KotlinAny?): 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)"
public fun copy(builder: Builder.() -> Unit): OperationInfo =
Builder().apply {
responseType = [email protected]
metadataType = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var responseType: String = ""
public var metadataType: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): OperationInfo =
OperationInfo(
responseType,
metadataType,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
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())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): OperationInfo = Builder().apply(dsl).build()
}
}