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

xyz.block.ftl.v1.CallRequest.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.CallRequest 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 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 CallRequest(
  @field:WireField(
    tag = 1,
    adapter = "xyz.block.ftl.v1.Metadata#ADAPTER",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 0,
  )
  public val metadata: Metadata? = null,
  @field:WireField(
    tag = 2,
    adapter = "xyz.block.ftl.v1.schema.VerbRef#ADAPTER",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 1,
  )
  public val verb: VerbRef? = null,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 2,
  )
  public val body: ByteString = ByteString.EMPTY,
  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 CallRequest) return false
    if (unknownFields != other.unknownFields) return false
    if (metadata != other.metadata) return false
    if (verb != other.verb) return false
    if (body != other.body) return false
    return true
  }

  override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (metadata?.hashCode() ?: 0)
      result = result * 37 + (verb?.hashCode() ?: 0)
      result = result * 37 + body.hashCode()
      super.hashCode = result
    }
    return result
  }

  override fun toString(): String {
    val result = mutableListOf()
    if (metadata != null) result += """metadata=$metadata"""
    if (verb != null) result += """verb=$verb"""
    result += """body=$body"""
    return result.joinToString(prefix = "CallRequest{", separator = ", ", postfix = "}")
  }

  public fun copy(
    metadata: Metadata? = this.metadata,
    verb: VerbRef? = this.verb,
    body: ByteString = this.body,
    unknownFields: ByteString = this.unknownFields,
  ): CallRequest = CallRequest(metadata, verb, body, unknownFields)

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      CallRequest::class, 
      "type.googleapis.com/xyz.block.ftl.v1.CallRequest", 
      PROTO_3, 
      null, 
      "xyz/block/ftl/v1/ftl.proto"
    ) {
      override fun encodedSize(`value`: CallRequest): Int {
        var size = value.unknownFields.size
        if (value.metadata != null) size += Metadata.ADAPTER.encodedSizeWithTag(1, value.metadata)
        if (value.verb != null) size += VerbRef.ADAPTER.encodedSizeWithTag(2, value.verb)
        if (value.body != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(3,
            value.body)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: CallRequest) {
        if (value.metadata != null) Metadata.ADAPTER.encodeWithTag(writer, 1, value.metadata)
        if (value.verb != null) VerbRef.ADAPTER.encodeWithTag(writer, 2, value.verb)
        if (value.body != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.body)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: CallRequest) {
        writer.writeBytes(value.unknownFields)
        if (value.body != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.body)
        if (value.verb != null) VerbRef.ADAPTER.encodeWithTag(writer, 2, value.verb)
        if (value.metadata != null) Metadata.ADAPTER.encodeWithTag(writer, 1, value.metadata)
      }

      override fun decode(reader: ProtoReader): CallRequest {
        var metadata: Metadata? = null
        var verb: VerbRef? = null
        var body: ByteString = ByteString.EMPTY
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> metadata = Metadata.ADAPTER.decode(reader)
            2 -> verb = VerbRef.ADAPTER.decode(reader)
            3 -> body = ProtoAdapter.BYTES.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return CallRequest(
          metadata = metadata,
          verb = verb,
          body = body,
          unknownFields = unknownFields
        )
      }

      override fun redact(`value`: CallRequest): CallRequest = value.copy(
        metadata = value.metadata?.let(Metadata.ADAPTER::redact),
        verb = value.verb?.let(VerbRef.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy