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

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

There is a newer version: 0.133.2
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: xyz.block.ftl.v1.console.CallEvent in xyz/block/ftl/v1/console/console.proto
package xyz.block.ftl.v1.console

import com.squareup.wire.Duration
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`.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 okio.ByteString
import xyz.block.ftl.v1.schema.VerbRef

public class CallEvent(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    jsonName = "requestName",
    schemaIndex = 0,
  )
  public val request_name: String? = null,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "deploymentName",
    schemaIndex = 1,
  )
  public val deployment_name: String = "",
  @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 = "xyz.block.ftl.v1.schema.VerbRef#ADAPTER",
    jsonName = "sourceVerbRef",
    schemaIndex = 3,
  )
  public val source_verb_ref: VerbRef? = null,
  @field:WireField(
    tag = 5,
    adapter = "xyz.block.ftl.v1.schema.VerbRef#ADAPTER",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "destinationVerbRef",
    schemaIndex = 4,
  )
  public val destination_verb_ref: VerbRef? = null,
  @field:WireField(
    tag = 6,
    adapter = "com.squareup.wire.ProtoAdapter#DURATION",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 5,
  )
  public val duration: Duration? = null,
  @field:WireField(
    tag = 7,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 6,
  )
  public val request: String = "",
  @field:WireField(
    tag = 8,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 7,
  )
  public val response: String = "",
  @field:WireField(
    tag = 9,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    schemaIndex = 8,
  )
  public val error: String? = null,
  @field:WireField(
    tag = 10,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    schemaIndex = 9,
  )
  public val stack: String? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @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 CallEvent) return false
    if (unknownFields != other.unknownFields) return false
    if (request_name != other.request_name) return false
    if (deployment_name != other.deployment_name) return false
    if (time_stamp != other.time_stamp) return false
    if (source_verb_ref != other.source_verb_ref) return false
    if (destination_verb_ref != other.destination_verb_ref) return false
    if (duration != other.duration) return false
    if (request != other.request) return false
    if (response != other.response) 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 + (request_name?.hashCode() ?: 0)
      result = result * 37 + deployment_name.hashCode()
      result = result * 37 + (time_stamp?.hashCode() ?: 0)
      result = result * 37 + (source_verb_ref?.hashCode() ?: 0)
      result = result * 37 + (destination_verb_ref?.hashCode() ?: 0)
      result = result * 37 + (duration?.hashCode() ?: 0)
      result = result * 37 + request.hashCode()
      result = result * 37 + response.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()
    if (request_name != null) result += """request_name=${sanitize(request_name)}"""
    result += """deployment_name=${sanitize(deployment_name)}"""
    if (time_stamp != null) result += """time_stamp=$time_stamp"""
    if (source_verb_ref != null) result += """source_verb_ref=$source_verb_ref"""
    if (destination_verb_ref != null) result += """destination_verb_ref=$destination_verb_ref"""
    if (duration != null) result += """duration=$duration"""
    result += """request=${sanitize(request)}"""
    result += """response=${sanitize(response)}"""
    if (error != null) result += """error=${sanitize(error)}"""
    if (stack != null) result += """stack=${sanitize(stack)}"""
    return result.joinToString(prefix = "CallEvent{", separator = ", ", postfix = "}")
  }

  public fun copy(
    request_name: String? = this.request_name,
    deployment_name: String = this.deployment_name,
    time_stamp: Instant? = this.time_stamp,
    source_verb_ref: VerbRef? = this.source_verb_ref,
    destination_verb_ref: VerbRef? = this.destination_verb_ref,
    duration: Duration? = this.duration,
    request: String = this.request,
    response: String = this.response,
    error: String? = this.error,
    stack: String? = this.stack,
    unknownFields: ByteString = this.unknownFields,
  ): CallEvent = CallEvent(request_name, deployment_name, time_stamp, source_verb_ref,
      destination_verb_ref, duration, request, response, error, stack, unknownFields)

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      CallEvent::class, 
      "type.googleapis.com/xyz.block.ftl.v1.console.CallEvent", 
      PROTO_3, 
      null, 
      "xyz/block/ftl/v1/console/console.proto"
    ) {
      override fun encodedSize(`value`: CallEvent): Int {
        var size = value.unknownFields.size
        size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.request_name)
        if (value.deployment_name != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2,
            value.deployment_name)
        if (value.time_stamp != null) size += ProtoAdapter.INSTANT.encodedSizeWithTag(3,
            value.time_stamp)
        size += VerbRef.ADAPTER.encodedSizeWithTag(4, value.source_verb_ref)
        if (value.destination_verb_ref != null) size += VerbRef.ADAPTER.encodedSizeWithTag(5,
            value.destination_verb_ref)
        if (value.duration != null) size += ProtoAdapter.DURATION.encodedSizeWithTag(6,
            value.duration)
        if (value.request != "") size += ProtoAdapter.STRING.encodedSizeWithTag(7, value.request)
        if (value.response != "") size += ProtoAdapter.STRING.encodedSizeWithTag(8, value.response)
        size += ProtoAdapter.STRING.encodedSizeWithTag(9, value.error)
        size += ProtoAdapter.STRING.encodedSizeWithTag(10, value.stack)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: CallEvent) {
        ProtoAdapter.STRING.encodeWithTag(writer, 1, value.request_name)
        if (value.deployment_name != "") ProtoAdapter.STRING.encodeWithTag(writer, 2,
            value.deployment_name)
        if (value.time_stamp != null) ProtoAdapter.INSTANT.encodeWithTag(writer, 3,
            value.time_stamp)
        VerbRef.ADAPTER.encodeWithTag(writer, 4, value.source_verb_ref)
        if (value.destination_verb_ref != null) VerbRef.ADAPTER.encodeWithTag(writer, 5,
            value.destination_verb_ref)
        if (value.duration != null) ProtoAdapter.DURATION.encodeWithTag(writer, 6, value.duration)
        if (value.request != "") ProtoAdapter.STRING.encodeWithTag(writer, 7, value.request)
        if (value.response != "") ProtoAdapter.STRING.encodeWithTag(writer, 8, value.response)
        ProtoAdapter.STRING.encodeWithTag(writer, 9, value.error)
        ProtoAdapter.STRING.encodeWithTag(writer, 10, value.stack)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: CallEvent) {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.STRING.encodeWithTag(writer, 10, value.stack)
        ProtoAdapter.STRING.encodeWithTag(writer, 9, value.error)
        if (value.response != "") ProtoAdapter.STRING.encodeWithTag(writer, 8, value.response)
        if (value.request != "") ProtoAdapter.STRING.encodeWithTag(writer, 7, value.request)
        if (value.duration != null) ProtoAdapter.DURATION.encodeWithTag(writer, 6, value.duration)
        if (value.destination_verb_ref != null) VerbRef.ADAPTER.encodeWithTag(writer, 5,
            value.destination_verb_ref)
        VerbRef.ADAPTER.encodeWithTag(writer, 4, value.source_verb_ref)
        if (value.time_stamp != null) ProtoAdapter.INSTANT.encodeWithTag(writer, 3,
            value.time_stamp)
        if (value.deployment_name != "") ProtoAdapter.STRING.encodeWithTag(writer, 2,
            value.deployment_name)
        ProtoAdapter.STRING.encodeWithTag(writer, 1, value.request_name)
      }

      override fun decode(reader: ProtoReader): CallEvent {
        var request_name: String? = null
        var deployment_name: String = ""
        var time_stamp: Instant? = null
        var source_verb_ref: VerbRef? = null
        var destination_verb_ref: VerbRef? = null
        var duration: Duration? = null
        var request: String = ""
        var response: String = ""
        var error: String? = null
        var stack: String? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> request_name = ProtoAdapter.STRING.decode(reader)
            2 -> deployment_name = ProtoAdapter.STRING.decode(reader)
            3 -> time_stamp = ProtoAdapter.INSTANT.decode(reader)
            4 -> source_verb_ref = VerbRef.ADAPTER.decode(reader)
            5 -> destination_verb_ref = VerbRef.ADAPTER.decode(reader)
            6 -> duration = ProtoAdapter.DURATION.decode(reader)
            7 -> request = ProtoAdapter.STRING.decode(reader)
            8 -> response = ProtoAdapter.STRING.decode(reader)
            9 -> error = ProtoAdapter.STRING.decode(reader)
            10 -> stack = ProtoAdapter.STRING.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return CallEvent(
          request_name = request_name,
          deployment_name = deployment_name,
          time_stamp = time_stamp,
          source_verb_ref = source_verb_ref,
          destination_verb_ref = destination_verb_ref,
          duration = duration,
          request = request,
          response = response,
          error = error,
          stack = stack,
          unknownFields = unknownFields
        )
      }

      override fun redact(`value`: CallEvent): CallEvent = value.copy(
        time_stamp = value.time_stamp?.let(ProtoAdapter.INSTANT::redact),
        source_verb_ref = value.source_verb_ref?.let(VerbRef.ADAPTER::redact),
        destination_verb_ref = value.destination_verb_ref?.let(VerbRef.ADAPTER::redact),
        duration = value.duration?.let(ProtoAdapter.DURATION::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy