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

commonMain.hiveline.stream.InitialPeers.kt Maven / Gradle / Ivy

Go to download

KMP package which exports compiled protobuf entities to be used by other repos

There is a newer version: 2.89.0
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: hiveline.stream.InitialPeers in hiveline/stream.proto
package hiveline.stream

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`.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.Unit
import kotlin.collections.List
import okio.ByteString

/**
 * message SelectedPeersDiffEventRequest {
 *   string room_id = 1;
 *   SelectedPeersDiff peers_diff = 2;
 * }
 * message SelectedPeersDiff { repeated SelectedPeersDiffEntry entries = 1; }
 */
public class InitialPeers(
  audio_peers: List = emptyList(),
  compulsory_peers: List = emptyList(),
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.REPEATED,
    jsonName = "audioPeers",
  )
  public val audio_peers: List = immutableCopyOf("audio_peers", audio_peers)

  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.REPEATED,
    jsonName = "compulsoryPeers",
  )
  public val compulsory_peers: List = immutableCopyOf("compulsory_peers", compulsory_peers)

  @Deprecated(
    message = "Shouldn't be used in Kotlin",
    level = DeprecationLevel.HIDDEN,
  )
  public 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")

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is InitialPeers) return false
    if (unknownFields != other.unknownFields) return false
    if (audio_peers != other.audio_peers) return false
    if (compulsory_peers != other.compulsory_peers) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + audio_peers.hashCode()
      result = result * 37 + compulsory_peers.hashCode()
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (audio_peers.isNotEmpty()) result += """audio_peers=${sanitize(audio_peers)}"""
    if (compulsory_peers.isNotEmpty()) result +=
        """compulsory_peers=${sanitize(compulsory_peers)}"""
    return result.joinToString(prefix = "InitialPeers{", separator = ", ", postfix = "}")
  }

  public fun copy(
    audio_peers: List = this.audio_peers,
    compulsory_peers: List = this.compulsory_peers,
    unknownFields: ByteString = this.unknownFields,
  ): InitialPeers = InitialPeers(audio_peers, compulsory_peers, unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      InitialPeers::class, 
      "type.googleapis.com/hiveline.stream.InitialPeers", 
      PROTO_3, 
      null, 
      "hiveline/stream.proto"
    ) {
      public override fun encodedSize(`value`: InitialPeers): Int {
        var size = value.unknownFields.size
        size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(1, value.audio_peers)
        size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(2, value.compulsory_peers)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: InitialPeers): Unit {
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1, value.audio_peers)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 2, value.compulsory_peers)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: InitialPeers): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 2, value.compulsory_peers)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1, value.audio_peers)
      }

      public override fun decode(reader: ProtoReader): InitialPeers {
        val audio_peers = mutableListOf()
        val compulsory_peers = mutableListOf()
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> audio_peers.add(ProtoAdapter.STRING.decode(reader))
            2 -> compulsory_peers.add(ProtoAdapter.STRING.decode(reader))
            else -> reader.readUnknownField(tag)
          }
        }
        return InitialPeers(
          audio_peers = audio_peers,
          compulsory_peers = compulsory_peers,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: InitialPeers): InitialPeers = value.copy(
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy