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

commonMain.socket.room.JoinRoomRequest.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: socket.room.JoinRoomRequest in socket/room.proto
package socket.room

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

public class JoinRoomRequest(
  @field:WireField(
    tag = 1,
    adapter = "socket.room.Peer#ADAPTER",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val peer: Peer? = null,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "roomUuid",
  )
  public val room_uuid: String = "",
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    jsonName = "organizationId",
  )
  public val organization_id: String? = null,
  @field:WireField(
    tag = 5,
    adapter = "com.squareup.wire.ProtoAdapter#BOOL",
    jsonName = "useHive",
  )
  public val use_hive: Boolean? = null,
  /**
   * making optional because field required for edge to hub communication only
   */
  @field:WireField(
    tag = 6,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  public val preset: ByteString? = null,
  capabilities: List = emptyList(),
  @field:WireField(
    tag = 8,
    adapter = "com.squareup.wire.ProtoAdapter#UINT64",
  )
  public val timestamp: Long? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 7,
    adapter = "socket.room.Capabilities#ADAPTER",
    label = WireField.Label.REPEATED,
  )
  public val capabilities: List = immutableCopyOf("capabilities", capabilities)

  @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 JoinRoomRequest) return false
    if (unknownFields != other.unknownFields) return false
    if (peer != other.peer) return false
    if (room_uuid != other.room_uuid) return false
    if (organization_id != other.organization_id) return false
    if (use_hive != other.use_hive) return false
    if (preset != other.preset) return false
    if (capabilities != other.capabilities) return false
    if (timestamp != other.timestamp) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (peer?.hashCode() ?: 0)
      result = result * 37 + room_uuid.hashCode()
      result = result * 37 + (organization_id?.hashCode() ?: 0)
      result = result * 37 + (use_hive?.hashCode() ?: 0)
      result = result * 37 + (preset?.hashCode() ?: 0)
      result = result * 37 + capabilities.hashCode()
      result = result * 37 + (timestamp?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (peer != null) result += """peer=$peer"""
    result += """room_uuid=${sanitize(room_uuid)}"""
    if (organization_id != null) result += """organization_id=${sanitize(organization_id)}"""
    if (use_hive != null) result += """use_hive=$use_hive"""
    if (preset != null) result += """preset=$preset"""
    if (capabilities.isNotEmpty()) result += """capabilities=$capabilities"""
    if (timestamp != null) result += """timestamp=$timestamp"""
    return result.joinToString(prefix = "JoinRoomRequest{", separator = ", ", postfix = "}")
  }

  public fun copy(
    peer: Peer? = this.peer,
    room_uuid: String = this.room_uuid,
    organization_id: String? = this.organization_id,
    use_hive: Boolean? = this.use_hive,
    preset: ByteString? = this.preset,
    capabilities: List = this.capabilities,
    timestamp: Long? = this.timestamp,
    unknownFields: ByteString = this.unknownFields,
  ): JoinRoomRequest = JoinRoomRequest(peer, room_uuid, organization_id, use_hive, preset,
      capabilities, timestamp, unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      JoinRoomRequest::class, 
      "type.googleapis.com/socket.room.JoinRoomRequest", 
      PROTO_3, 
      null, 
      "socket/room.proto"
    ) {
      public override fun encodedSize(`value`: JoinRoomRequest): Int {
        var size = value.unknownFields.size
        if (value.peer != null) size += Peer.ADAPTER.encodedSizeWithTag(1, value.peer)
        if (value.room_uuid != "") size += ProtoAdapter.STRING.encodedSizeWithTag(3,
            value.room_uuid)
        size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.organization_id)
        size += ProtoAdapter.BOOL.encodedSizeWithTag(5, value.use_hive)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(6, value.preset)
        size += Capabilities.ADAPTER.asRepeated().encodedSizeWithTag(7, value.capabilities)
        size += ProtoAdapter.UINT64.encodedSizeWithTag(8, value.timestamp)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: JoinRoomRequest): Unit {
        if (value.peer != null) Peer.ADAPTER.encodeWithTag(writer, 1, value.peer)
        if (value.room_uuid != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.room_uuid)
        ProtoAdapter.STRING.encodeWithTag(writer, 4, value.organization_id)
        ProtoAdapter.BOOL.encodeWithTag(writer, 5, value.use_hive)
        ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.preset)
        Capabilities.ADAPTER.asRepeated().encodeWithTag(writer, 7, value.capabilities)
        ProtoAdapter.UINT64.encodeWithTag(writer, 8, value.timestamp)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: JoinRoomRequest): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.UINT64.encodeWithTag(writer, 8, value.timestamp)
        Capabilities.ADAPTER.asRepeated().encodeWithTag(writer, 7, value.capabilities)
        ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.preset)
        ProtoAdapter.BOOL.encodeWithTag(writer, 5, value.use_hive)
        ProtoAdapter.STRING.encodeWithTag(writer, 4, value.organization_id)
        if (value.room_uuid != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.room_uuid)
        if (value.peer != null) Peer.ADAPTER.encodeWithTag(writer, 1, value.peer)
      }

      public override fun decode(reader: ProtoReader): JoinRoomRequest {
        var peer: Peer? = null
        var room_uuid: String = ""
        var organization_id: String? = null
        var use_hive: Boolean? = null
        var preset: ByteString? = null
        val capabilities = mutableListOf()
        var timestamp: Long? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> peer = Peer.ADAPTER.decode(reader)
            3 -> room_uuid = ProtoAdapter.STRING.decode(reader)
            4 -> organization_id = ProtoAdapter.STRING.decode(reader)
            5 -> use_hive = ProtoAdapter.BOOL.decode(reader)
            6 -> preset = ProtoAdapter.BYTES.decode(reader)
            7 -> try {
              Capabilities.ADAPTER.tryDecode(reader, capabilities)
            } catch (e: ProtoAdapter.EnumConstantNotFoundException) {
              reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
            }
            8 -> timestamp = ProtoAdapter.UINT64.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return JoinRoomRequest(
          peer = peer,
          room_uuid = room_uuid,
          organization_id = organization_id,
          use_hive = use_hive,
          preset = preset,
          capabilities = capabilities,
          timestamp = timestamp,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: JoinRoomRequest): JoinRoomRequest = value.copy(
        peer = value.peer?.let(Peer.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy