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

xyz.block.ftl.v1.console.LogEvent.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.LogEvent in xyz/block/ftl/v1/console/console.proto
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`.immutableCopyOf
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 kotlin.lazy
import okio.ByteString

public class LogEvent(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "deploymentName",
    schemaIndex = 0,
  )
  public val deployment_name: String = "",
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    jsonName = "requestName",
    schemaIndex = 1,
  )
  public val request_name: String? = null,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#INSTANT",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "timeStamp",
    schemaIndex = 2,
  )
  public val time_stamp: Instant? = null,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "logLevel",
    schemaIndex = 3,
  )
  public val log_level: Int = 0,
  attributes: Map = emptyMap(),
  @field:WireField(
    tag = 6,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 5,
  )
  public val message: String = "",
  @field:WireField(
    tag = 7,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    schemaIndex = 6,
  )
  public val error: String? = null,
  @field:WireField(
    tag = 8,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    schemaIndex = 7,
  )
  public val stack: String? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 5,
    keyAdapter = "com.squareup.wire.ProtoAdapter#STRING",
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    schemaIndex = 4,
  )
  public val attributes: Map = immutableCopyOf("attributes", attributes)

  @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 LogEvent) return false
    if (unknownFields != other.unknownFields) return false
    if (deployment_name != other.deployment_name) return false
    if (request_name != other.request_name) return false
    if (time_stamp != other.time_stamp) return false
    if (log_level != other.log_level) return false
    if (attributes != other.attributes) return false
    if (message != other.message) return false
    if (error != other.error) return false
    if (stack != other.stack) return false
    return true
  }

  override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + deployment_name.hashCode()
      result = result * 37 + (request_name?.hashCode() ?: 0)
      result = result * 37 + (time_stamp?.hashCode() ?: 0)
      result = result * 37 + log_level.hashCode()
      result = result * 37 + attributes.hashCode()
      result = result * 37 + message.hashCode()
      result = result * 37 + (error?.hashCode() ?: 0)
      result = result * 37 + (stack?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  override fun toString(): String {
    val result = mutableListOf()
    result += """deployment_name=${sanitize(deployment_name)}"""
    if (request_name != null) result += """request_name=${sanitize(request_name)}"""
    if (time_stamp != null) result += """time_stamp=$time_stamp"""
    result += """log_level=$log_level"""
    if (attributes.isNotEmpty()) result += """attributes=$attributes"""
    result += """message=${sanitize(message)}"""
    if (error != null) result += """error=${sanitize(error)}"""
    if (stack != null) result += """stack=${sanitize(stack)}"""
    return result.joinToString(prefix = "LogEvent{", separator = ", ", postfix = "}")
  }

  public fun copy(
    deployment_name: String = this.deployment_name,
    request_name: String? = this.request_name,
    time_stamp: Instant? = this.time_stamp,
    log_level: Int = this.log_level,
    attributes: Map = this.attributes,
    message: String = this.message,
    error: String? = this.error,
    stack: String? = this.stack,
    unknownFields: ByteString = this.unknownFields,
  ): LogEvent = LogEvent(deployment_name, request_name, time_stamp, log_level, attributes, message,
      error, stack, unknownFields)

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      LogEvent::class, 
      "type.googleapis.com/xyz.block.ftl.v1.console.LogEvent", 
      PROTO_3, 
      null, 
      "xyz/block/ftl/v1/console/console.proto"
    ) {
      private val attributesAdapter: ProtoAdapter> by lazy {
          ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING) }

      override fun encodedSize(`value`: LogEvent): Int {
        var size = value.unknownFields.size
        if (value.deployment_name != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1,
            value.deployment_name)
        size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.request_name)
        if (value.time_stamp != null) size += ProtoAdapter.INSTANT.encodedSizeWithTag(3,
            value.time_stamp)
        if (value.log_level != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(4, value.log_level)
        size += attributesAdapter.encodedSizeWithTag(5, value.attributes)
        if (value.message != "") size += ProtoAdapter.STRING.encodedSizeWithTag(6, value.message)
        size += ProtoAdapter.STRING.encodedSizeWithTag(7, value.error)
        size += ProtoAdapter.STRING.encodedSizeWithTag(8, value.stack)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: LogEvent) {
        if (value.deployment_name != "") ProtoAdapter.STRING.encodeWithTag(writer, 1,
            value.deployment_name)
        ProtoAdapter.STRING.encodeWithTag(writer, 2, value.request_name)
        if (value.time_stamp != null) ProtoAdapter.INSTANT.encodeWithTag(writer, 3,
            value.time_stamp)
        if (value.log_level != 0) ProtoAdapter.INT32.encodeWithTag(writer, 4, value.log_level)
        attributesAdapter.encodeWithTag(writer, 5, value.attributes)
        if (value.message != "") ProtoAdapter.STRING.encodeWithTag(writer, 6, value.message)
        ProtoAdapter.STRING.encodeWithTag(writer, 7, value.error)
        ProtoAdapter.STRING.encodeWithTag(writer, 8, value.stack)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: LogEvent) {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.STRING.encodeWithTag(writer, 8, value.stack)
        ProtoAdapter.STRING.encodeWithTag(writer, 7, value.error)
        if (value.message != "") ProtoAdapter.STRING.encodeWithTag(writer, 6, value.message)
        attributesAdapter.encodeWithTag(writer, 5, value.attributes)
        if (value.log_level != 0) ProtoAdapter.INT32.encodeWithTag(writer, 4, value.log_level)
        if (value.time_stamp != null) ProtoAdapter.INSTANT.encodeWithTag(writer, 3,
            value.time_stamp)
        ProtoAdapter.STRING.encodeWithTag(writer, 2, value.request_name)
        if (value.deployment_name != "") ProtoAdapter.STRING.encodeWithTag(writer, 1,
            value.deployment_name)
      }

      override fun decode(reader: ProtoReader): LogEvent {
        var deployment_name: String = ""
        var request_name: String? = null
        var time_stamp: Instant? = null
        var log_level: Int = 0
        val attributes = mutableMapOf()
        var message: String = ""
        var error: String? = null
        var stack: String? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> deployment_name = ProtoAdapter.STRING.decode(reader)
            2 -> request_name = ProtoAdapter.STRING.decode(reader)
            3 -> time_stamp = ProtoAdapter.INSTANT.decode(reader)
            4 -> log_level = ProtoAdapter.INT32.decode(reader)
            5 -> attributes.putAll(attributesAdapter.decode(reader))
            6 -> message = ProtoAdapter.STRING.decode(reader)
            7 -> error = ProtoAdapter.STRING.decode(reader)
            8 -> stack = ProtoAdapter.STRING.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return LogEvent(
          deployment_name = deployment_name,
          request_name = request_name,
          time_stamp = time_stamp,
          log_level = log_level,
          attributes = attributes,
          message = message,
          error = error,
          stack = stack,
          unknownFields = unknownFields
        )
      }

      override fun redact(`value`: LogEvent): LogEvent = value.copy(
        time_stamp = value.time_stamp?.let(ProtoAdapter.INSTANT::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy