xyz.block.ftl.v1.RegisterRunnerRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ftl-generator Show documentation
Show all versions of ftl-generator Show documentation
Towards a 𝝺-calculus for large-scale systems
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: xyz.block.ftl.v1.RegisterRunnerRequest in xyz/block/ftl/v1/ftl.proto
package xyz.block.ftl.v1
import com.squareup.wire.FieldEncoding
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.ProtoReader
import com.squareup.wire.ProtoWriter
import com.squareup.wire.ReverseProtoWriter
import com.squareup.wire.Syntax.PROTO_3
import com.squareup.wire.WireField
import com.squareup.wire.`internal`.JvmField
import com.squareup.wire.`internal`.immutableCopyOfStruct
import com.squareup.wire.`internal`.sanitize
import kotlin.Any
import kotlin.AssertionError
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.DeprecationLevel
import kotlin.Int
import kotlin.Long
import kotlin.Nothing
import kotlin.String
import kotlin.collections.Map
import okio.ByteString
public class RegisterRunnerRequest(
/**
* UUID representing the runner instance.
*/
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
schemaIndex = 0,
)
public val key: String = "",
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
schemaIndex = 1,
)
public val endpoint: String = "",
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
schemaIndex = 2,
)
public val deployment: String? = null,
@field:WireField(
tag = 4,
adapter = "xyz.block.ftl.v1.RunnerState#ADAPTER",
label = WireField.Label.OMIT_IDENTITY,
schemaIndex = 3,
)
public val state: RunnerState = RunnerState.RUNNER_IDLE,
labels: Map? = null,
/**
* If present, the reason the Runner is transitioning from ASSIGNED to IDLE.
*/
@field:WireField(
tag = 7,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
schemaIndex = 5,
)
public val error: String? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
@field:WireField(
tag = 5,
adapter = "com.squareup.wire.ProtoAdapter#STRUCT_MAP",
label = WireField.Label.OMIT_IDENTITY,
schemaIndex = 4,
)
public val labels: Map? = immutableCopyOfStruct("labels", labels)
@Deprecated(
message = "Shouldn't be used in Kotlin",
level = DeprecationLevel.HIDDEN,
)
override fun newBuilder(): Nothing = throw
AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin")
override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is RegisterRunnerRequest) return false
if (unknownFields != other.unknownFields) return false
if (key != other.key) return false
if (endpoint != other.endpoint) return false
if (deployment != other.deployment) return false
if (state != other.state) return false
if (labels != other.labels) return false
if (error != other.error) return false
return true
}
override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + key.hashCode()
result = result * 37 + endpoint.hashCode()
result = result * 37 + (deployment?.hashCode() ?: 0)
result = result * 37 + state.hashCode()
result = result * 37 + (labels?.hashCode() ?: 0)
result = result * 37 + (error?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
override fun toString(): String {
val result = mutableListOf()
result += """key=${sanitize(key)}"""
result += """endpoint=${sanitize(endpoint)}"""
if (deployment != null) result += """deployment=${sanitize(deployment)}"""
result += """state=$state"""
if (labels != null) result += """labels=$labels"""
if (error != null) result += """error=${sanitize(error)}"""
return result.joinToString(prefix = "RegisterRunnerRequest{", separator = ", ", postfix = "}")
}
public fun copy(
key: String = this.key,
endpoint: String = this.endpoint,
deployment: String? = this.deployment,
state: RunnerState = this.state,
labels: Map? = this.labels,
error: String? = this.error,
unknownFields: ByteString = this.unknownFields,
): RegisterRunnerRequest = RegisterRunnerRequest(key, endpoint, deployment, state, labels, error,
unknownFields)
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object :
ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
RegisterRunnerRequest::class,
"type.googleapis.com/xyz.block.ftl.v1.RegisterRunnerRequest",
PROTO_3,
null,
"xyz/block/ftl/v1/ftl.proto"
) {
override fun encodedSize(`value`: RegisterRunnerRequest): Int {
var size = value.unknownFields.size
if (value.key != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.key)
if (value.endpoint != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.endpoint)
size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.deployment)
if (value.state != RunnerState.RUNNER_IDLE) size +=
RunnerState.ADAPTER.encodedSizeWithTag(4, value.state)
if (value.labels != null) size += ProtoAdapter.STRUCT_MAP.encodedSizeWithTag(5,
value.labels)
size += ProtoAdapter.STRING.encodedSizeWithTag(7, value.error)
return size
}
override fun encode(writer: ProtoWriter, `value`: RegisterRunnerRequest) {
if (value.key != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.key)
if (value.endpoint != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.endpoint)
ProtoAdapter.STRING.encodeWithTag(writer, 3, value.deployment)
if (value.state != RunnerState.RUNNER_IDLE) RunnerState.ADAPTER.encodeWithTag(writer, 4,
value.state)
if (value.labels != null) ProtoAdapter.STRUCT_MAP.encodeWithTag(writer, 5, value.labels)
ProtoAdapter.STRING.encodeWithTag(writer, 7, value.error)
writer.writeBytes(value.unknownFields)
}
override fun encode(writer: ReverseProtoWriter, `value`: RegisterRunnerRequest) {
writer.writeBytes(value.unknownFields)
ProtoAdapter.STRING.encodeWithTag(writer, 7, value.error)
if (value.labels != null) ProtoAdapter.STRUCT_MAP.encodeWithTag(writer, 5, value.labels)
if (value.state != RunnerState.RUNNER_IDLE) RunnerState.ADAPTER.encodeWithTag(writer, 4,
value.state)
ProtoAdapter.STRING.encodeWithTag(writer, 3, value.deployment)
if (value.endpoint != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.endpoint)
if (value.key != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.key)
}
override fun decode(reader: ProtoReader): RegisterRunnerRequest {
var key: String = ""
var endpoint: String = ""
var deployment: String? = null
var state: RunnerState = RunnerState.RUNNER_IDLE
var labels: Map? = null
var error: String? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> key = ProtoAdapter.STRING.decode(reader)
2 -> endpoint = ProtoAdapter.STRING.decode(reader)
3 -> deployment = ProtoAdapter.STRING.decode(reader)
4 -> try {
state = RunnerState.ADAPTER.decode(reader)
} catch (e: ProtoAdapter.EnumConstantNotFoundException) {
reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
}
5 -> labels = ProtoAdapter.STRUCT_MAP.decode(reader)
7 -> error = ProtoAdapter.STRING.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return RegisterRunnerRequest(
key = key,
endpoint = endpoint,
deployment = deployment,
state = state,
labels = labels,
error = error,
unknownFields = unknownFields
)
}
override fun redact(`value`: RegisterRunnerRequest): RegisterRunnerRequest = value.copy(
labels = value.labels?.let(ProtoAdapter.STRUCT_MAP::redact),
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}