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.189.0
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
@file:Suppress("DEPRECATION")

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.Suppress
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 = "deploymentKey",
    schemaIndex = 1,
  )
  public val deployment_key: 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(),
  secrets: List = emptyList(),
  configs: 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_)

  @field:WireField(
    tag = 7,
    adapter = "xyz.block.ftl.v1.console.Secret#ADAPTER",
    label = WireField.Label.REPEATED,
    schemaIndex = 6,
  )
  public val secrets: List = immutableCopyOf("secrets", secrets)

  @field:WireField(
    tag = 8,
    adapter = "xyz.block.ftl.v1.console.Config#ADAPTER",
    label = WireField.Label.REPEATED,
    schemaIndex = 7,
  )
  public val configs: List = immutableCopyOf("configs", configs)

  @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_key != other.deployment_key) 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
    if (secrets != other.secrets) return false
    if (configs != other.configs) 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_key.hashCode()
      result = result * 37 + language.hashCode()
      result = result * 37 + schema.hashCode()
      result = result * 37 + verbs.hashCode()
      result = result * 37 + data_.hashCode()
      result = result * 37 + secrets.hashCode()
      result = result * 37 + configs.hashCode()
      super.hashCode = result
    }
    return result
  }

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

  public fun copy(
    name: String = this.name,
    deployment_key: String = this.deployment_key,
    language: String = this.language,
    schema: String = this.schema,
    verbs: List = this.verbs,
    data_: List = this.data_,
    secrets: List = this.secrets,
    configs: List = this.configs,
    unknownFields: ByteString = this.unknownFields,
  ): Module = Module(name, deployment_key, language, schema, verbs, data_, secrets, configs,
      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_key != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2,
            value.deployment_key)
        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_)
        size += Secret.ADAPTER.asRepeated().encodedSizeWithTag(7, value.secrets)
        size += Config.ADAPTER.asRepeated().encodedSizeWithTag(8, value.configs)
        return size
      }

      override fun encode(writer: ProtoWriter, `value`: Module) {
        if (value.name != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.name)
        if (value.deployment_key != "") ProtoAdapter.STRING.encodeWithTag(writer, 2,
            value.deployment_key)
        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_)
        Secret.ADAPTER.asRepeated().encodeWithTag(writer, 7, value.secrets)
        Config.ADAPTER.asRepeated().encodeWithTag(writer, 8, value.configs)
        writer.writeBytes(value.unknownFields)
      }

      override fun encode(writer: ReverseProtoWriter, `value`: Module) {
        writer.writeBytes(value.unknownFields)
        Config.ADAPTER.asRepeated().encodeWithTag(writer, 8, value.configs)
        Secret.ADAPTER.asRepeated().encodeWithTag(writer, 7, value.secrets)
        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_key != "") ProtoAdapter.STRING.encodeWithTag(writer, 2,
            value.deployment_key)
        if (value.name != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.name)
      }

      override fun decode(reader: ProtoReader): Module {
        var name: String = ""
        var deployment_key: String = ""
        var language: String = ""
        var schema: String = ""
        val verbs = mutableListOf()
        val data_ = mutableListOf()
        val secrets = mutableListOf()
        val configs = mutableListOf()
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> name = ProtoAdapter.STRING.decode(reader)
            2 -> deployment_key = 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))
            7 -> secrets.add(Secret.ADAPTER.decode(reader))
            8 -> configs.add(Config.ADAPTER.decode(reader))
            else -> reader.readUnknownField(tag)
          }
        }
        return Module(
          name = name,
          deployment_key = deployment_key,
          language = language,
          schema = schema,
          verbs = verbs,
          data_ = data_,
          secrets = secrets,
          configs = configs,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy