All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.block.ftl.v1.console.Event.kt Maven / Gradle / Ivy

There is a newer version: 0.189.0
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: xyz.block.ftl.v1.console.Event in xyz/block/ftl/v1/console/console.proto
@file:Suppress("DEPRECATION")

package xyz.block.ftl.v1.console

import com.squareup.wire.FieldEncoding
import com.squareup.wire.Instant
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`.countNonNull
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.Suppress
import okio.ByteString

public class Event(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#INSTANT",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "timeStamp",
    schemaIndex = 0,
  )
  public val time_stamp: Instant? = null,
  /**
   * Unique ID for event.
   */
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 1,
  )
  public val id: Long = 0L,
  @field:WireField(
    tag = 3,
    adapter = "xyz.block.ftl.v1.console.LogEvent#ADAPTER",
    oneofName = "entry",
    schemaIndex = 2,
  )
  public val log: LogEvent? = null,
  @field:WireField(
    tag = 4,
    adapter = "xyz.block.ftl.v1.console.CallEvent#ADAPTER",
    oneofName = "entry",
    schemaIndex = 3,
  )
  public val call: CallEvent? = null,
  @field:WireField(
    tag = 5,
    adapter = "xyz.block.ftl.v1.console.DeploymentCreatedEvent#ADAPTER",
    jsonName = "deploymentCreated",
    oneofName = "entry",
    schemaIndex = 4,
  )
  public val deployment_created: DeploymentCreatedEvent? = null,
  @field:WireField(
    tag = 6,
    adapter = "xyz.block.ftl.v1.console.DeploymentUpdatedEvent#ADAPTER",
    jsonName = "deploymentUpdated",
    oneofName = "entry",
    schemaIndex = 5,
  )
  public val deployment_updated: DeploymentUpdatedEvent? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  init {
    require(countNonNull(log, call, deployment_created, deployment_updated) <= 1) {
      "At most one of log, call, deployment_created, deployment_updated may be non-null"
    }
  }

  @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 Event) return false
    if (unknownFields != other.unknownFields) return false
    if (time_stamp != other.time_stamp) return false
    if (id != other.id) return false
    if (log != other.log) return false
    if (call != other.call) return false
    if (deployment_created != other.deployment_created) return false
    if (deployment_updated != other.deployment_updated) return false
    return true
  }

  override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (time_stamp?.hashCode() ?: 0)
      result = result * 37 + id.hashCode()
      result = result * 37 + (log?.hashCode() ?: 0)
      result = result * 37 + (call?.hashCode() ?: 0)
      result = result * 37 + (deployment_created?.hashCode() ?: 0)
      result = result * 37 + (deployment_updated?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  override fun toString(): String {
    val result = mutableListOf()
    if (time_stamp != null) result += """time_stamp=$time_stamp"""
    result += """id=$id"""
    if (log != null) result += """log=$log"""
    if (call != null) result += """call=$call"""
    if (deployment_created != null) result += """deployment_created=$deployment_created"""
    if (deployment_updated != null) result += """deployment_updated=$deployment_updated"""
    return result.joinToString(prefix = "Event{", separator = ", ", postfix = "}")
  }

  public fun copy(
    time_stamp: Instant? = this.time_stamp,
    id: Long = this.id,
    log: LogEvent? = this.log,
    call: CallEvent? = this.call,
    deployment_created: DeploymentCreatedEvent? = this.deployment_created,
    deployment_updated: DeploymentUpdatedEvent? = this.deployment_updated,
    unknownFields: ByteString = this.unknownFields,
  ): Event = Event(time_stamp, id, log, call, deployment_created, deployment_updated, unknownFields)

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      Event::class, 
      "type.googleapis.com/xyz.block.ftl.v1.console.Event", 
      PROTO_3, 
      null, 
      "xyz/block/ftl/v1/console/console.proto"
    ) {
      override fun encodedSize(`value`: Event): Int {
        var size = value.unknownFields.size
        if (value.time_stamp != null) size += ProtoAdapter.INSTANT.encodedSizeWithTag(1,
            value.time_stamp)
        if (value.id != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(2, value.id)
        size += LogEvent.ADAPTER.encodedSizeWithTag(3, value.log)
        size += CallEvent.ADAPTER.encodedSizeWithTag(4, value.call)
        size += DeploymentCreatedEvent.ADAPTER.encodedSizeWithTag(5, value.deployment_created)
        size += DeploymentUpdatedEvent.ADAPTER.encodedSizeWithTag(6, value.deployment_updated)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: Event) {
        if (value.time_stamp != null) ProtoAdapter.INSTANT.encodeWithTag(writer, 1,
            value.time_stamp)
        if (value.id != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 2, value.id)
        LogEvent.ADAPTER.encodeWithTag(writer, 3, value.log)
        CallEvent.ADAPTER.encodeWithTag(writer, 4, value.call)
        DeploymentCreatedEvent.ADAPTER.encodeWithTag(writer, 5, value.deployment_created)
        DeploymentUpdatedEvent.ADAPTER.encodeWithTag(writer, 6, value.deployment_updated)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: Event) {
        writer.writeBytes(value.unknownFields)
        DeploymentUpdatedEvent.ADAPTER.encodeWithTag(writer, 6, value.deployment_updated)
        DeploymentCreatedEvent.ADAPTER.encodeWithTag(writer, 5, value.deployment_created)
        CallEvent.ADAPTER.encodeWithTag(writer, 4, value.call)
        LogEvent.ADAPTER.encodeWithTag(writer, 3, value.log)
        if (value.id != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 2, value.id)
        if (value.time_stamp != null) ProtoAdapter.INSTANT.encodeWithTag(writer, 1,
            value.time_stamp)
      }

      override fun decode(reader: ProtoReader): Event {
        var time_stamp: Instant? = null
        var id: Long = 0L
        var log: LogEvent? = null
        var call: CallEvent? = null
        var deployment_created: DeploymentCreatedEvent? = null
        var deployment_updated: DeploymentUpdatedEvent? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> time_stamp = ProtoAdapter.INSTANT.decode(reader)
            2 -> id = ProtoAdapter.INT64.decode(reader)
            3 -> log = LogEvent.ADAPTER.decode(reader)
            4 -> call = CallEvent.ADAPTER.decode(reader)
            5 -> deployment_created = DeploymentCreatedEvent.ADAPTER.decode(reader)
            6 -> deployment_updated = DeploymentUpdatedEvent.ADAPTER.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return Event(
          time_stamp = time_stamp,
          id = id,
          log = log,
          call = call,
          deployment_created = deployment_created,
          deployment_updated = deployment_updated,
          unknownFields = unknownFields
        )
      }

      override fun redact(`value`: Event): Event = value.copy(
        time_stamp = value.time_stamp?.let(ProtoAdapter.INSTANT::redact),
        log = value.log?.let(LogEvent.ADAPTER::redact),
        call = value.call?.let(CallEvent.ADAPTER::redact),
        deployment_created = value.deployment_created?.let(DeploymentCreatedEvent.ADAPTER::redact),
        deployment_updated = value.deployment_updated?.let(DeploymentUpdatedEvent.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy