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

xyz.block.ftl.v1.console.Module.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.Module in xyz/block/ftl/v1/console/console.proto
package xyz.block.ftl.v1.console

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`.immutableCopyOf
import com.squareup.wire.`internal`.redactElements
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.List
import okio.ByteString

public class Module(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 0,
  )
  public val name: String = "",
  @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#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 2,
  )
  public val language: String = "",
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    schemaIndex = 3,
  )
  public val schema: String = "",
  verbs: List = emptyList(),
  data_: List = emptyList(),
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 5,
    adapter = "xyz.block.ftl.v1.console.Verb#ADAPTER",
    label = WireField.Label.REPEATED,
    schemaIndex = 4,
  )
  public val verbs: List = immutableCopyOf("verbs", verbs)

  @field:WireField(
    tag = 6,
    adapter = "xyz.block.ftl.v1.console.Data#ADAPTER",
    label = WireField.Label.REPEATED,
    declaredName = "data",
    schemaIndex = 5,
  )
  public val data_: List = immutableCopyOf("data_", data_)

  @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 Module) return false
    if (unknownFields != other.unknownFields) return false
    if (name != other.name) return false
    if (deployment_name != other.deployment_name) return false
    if (language != other.language) return false
    if (schema != other.schema) return false
    if (verbs != other.verbs) return false
    if (data_ != other.data_) return false
    return true
  }

  override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + name.hashCode()
      result = result * 37 + deployment_name.hashCode()
      result = result * 37 + language.hashCode()
      result = result * 37 + schema.hashCode()
      result = result * 37 + verbs.hashCode()
      result = result * 37 + data_.hashCode()
      super.hashCode = result
    }
    return result
  }

  override fun toString(): String {
    val result = mutableListOf()
    result += """name=${sanitize(name)}"""
    result += """deployment_name=${sanitize(deployment_name)}"""
    result += """language=${sanitize(language)}"""
    result += """schema=${sanitize(schema)}"""
    if (verbs.isNotEmpty()) result += """verbs=$verbs"""
    if (data_.isNotEmpty()) result += """data_=$data_"""
    return result.joinToString(prefix = "Module{", separator = ", ", postfix = "}")
  }

  public fun copy(
    name: String = this.name,
    deployment_name: String = this.deployment_name,
    language: String = this.language,
    schema: String = this.schema,
    verbs: List = this.verbs,
    data_: List = this.data_,
    unknownFields: ByteString = this.unknownFields,
  ): Module = Module(name, deployment_name, language, schema, verbs, data_, unknownFields)

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      Module::class, 
      "type.googleapis.com/xyz.block.ftl.v1.console.Module", 
      PROTO_3, 
      null, 
      "xyz/block/ftl/v1/console/console.proto"
    ) {
      override fun encodedSize(`value`: Module): Int {
        var size = value.unknownFields.size
        if (value.name != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.name)
        if (value.deployment_name != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2,
            value.deployment_name)
        if (value.language != "") size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.language)
        if (value.schema != "") size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.schema)
        size += Verb.ADAPTER.asRepeated().encodedSizeWithTag(5, value.verbs)
        size += Data.ADAPTER.asRepeated().encodedSizeWithTag(6, value.data_)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: Module) {
        if (value.name != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.name)
        if (value.deployment_name != "") ProtoAdapter.STRING.encodeWithTag(writer, 2,
            value.deployment_name)
        if (value.language != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.language)
        if (value.schema != "") ProtoAdapter.STRING.encodeWithTag(writer, 4, value.schema)
        Verb.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.verbs)
        Data.ADAPTER.asRepeated().encodeWithTag(writer, 6, value.data_)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: Module) {
        writer.writeBytes(value.unknownFields)
        Data.ADAPTER.asRepeated().encodeWithTag(writer, 6, value.data_)
        Verb.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.verbs)
        if (value.schema != "") ProtoAdapter.STRING.encodeWithTag(writer, 4, value.schema)
        if (value.language != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.language)
        if (value.deployment_name != "") ProtoAdapter.STRING.encodeWithTag(writer, 2,
            value.deployment_name)
        if (value.name != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.name)
      }

      override fun decode(reader: ProtoReader): Module {
        var name: String = ""
        var deployment_name: String = ""
        var language: String = ""
        var schema: String = ""
        val verbs = mutableListOf()
        val data_ = mutableListOf()
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> name = ProtoAdapter.STRING.decode(reader)
            2 -> deployment_name = ProtoAdapter.STRING.decode(reader)
            3 -> language = ProtoAdapter.STRING.decode(reader)
            4 -> schema = ProtoAdapter.STRING.decode(reader)
            5 -> verbs.add(Verb.ADAPTER.decode(reader))
            6 -> data_.add(Data.ADAPTER.decode(reader))
            else -> reader.readUnknownField(tag)
          }
        }
        return Module(
          name = name,
          deployment_name = deployment_name,
          language = language,
          schema = schema,
          verbs = verbs,
          data_ = data_,
          unknownFields = unknownFields
        )
      }

      override fun redact(`value`: Module): Module = value.copy(
        verbs = value.verbs.redactElements(Verb.ADAPTER),
        data_ = value.data_.redactElements(Data.ADAPTER),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy