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

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

import com.squareup.wire.FieldEncoding
import com.squareup.wire.Instant
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`.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.Unit
import kotlin.collections.List
import okio.ByteString

public class Room(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "roomId",
  )
  public val room_id: String = "",
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val title: String = "",
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#INSTANT",
    jsonName = "obsoleteCreatedAt",
  )
  public val obsolete_created_at: Instant? = null,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#UINT64",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "createdAt",
  )
  public val created_at: Long = 0L,
  active_recordings: List = emptyList(),
  @field:WireField(
    tag = 6,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    jsonName = "roomUuid",
  )
  public val room_uuid: String? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 5,
    adapter = "socket.room.ActiveRecording#ADAPTER",
    label = WireField.Label.REPEATED,
    jsonName = "activeRecordings",
  )
  public val active_recordings: List = immutableCopyOf("active_recordings",
      active_recordings)

  @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 Room) return false
    if (unknownFields != other.unknownFields) return false
    if (room_id != other.room_id) return false
    if (title != other.title) return false
    if (obsolete_created_at != other.obsolete_created_at) return false
    if (created_at != other.created_at) return false
    if (active_recordings != other.active_recordings) return false
    if (room_uuid != other.room_uuid) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + room_id.hashCode()
      result = result * 37 + title.hashCode()
      result = result * 37 + (obsolete_created_at?.hashCode() ?: 0)
      result = result * 37 + created_at.hashCode()
      result = result * 37 + active_recordings.hashCode()
      result = result * 37 + (room_uuid?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    result += """room_id=${sanitize(room_id)}"""
    result += """title=${sanitize(title)}"""
    if (obsolete_created_at != null) result += """obsolete_created_at=$obsolete_created_at"""
    result += """created_at=$created_at"""
    if (active_recordings.isNotEmpty()) result += """active_recordings=$active_recordings"""
    if (room_uuid != null) result += """room_uuid=${sanitize(room_uuid)}"""
    return result.joinToString(prefix = "Room{", separator = ", ", postfix = "}")
  }

  public fun copy(
    room_id: String = this.room_id,
    title: String = this.title,
    obsolete_created_at: Instant? = this.obsolete_created_at,
    created_at: Long = this.created_at,
    active_recordings: List = this.active_recordings,
    room_uuid: String? = this.room_uuid,
    unknownFields: ByteString = this.unknownFields,
  ): Room = Room(room_id, title, obsolete_created_at, created_at, active_recordings, room_uuid,
      unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      Room::class, 
      "type.googleapis.com/socket.room.Room", 
      PROTO_3, 
      null, 
      "socket/room.proto"
    ) {
      public override fun encodedSize(`value`: Room): Int {
        var size = value.unknownFields.size
        if (value.room_id != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.room_id)
        if (value.title != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.title)
        size += ProtoAdapter.INSTANT.encodedSizeWithTag(3, value.obsolete_created_at)
        if (value.created_at != 0L) size += ProtoAdapter.UINT64.encodedSizeWithTag(4,
            value.created_at)
        size += ActiveRecording.ADAPTER.asRepeated().encodedSizeWithTag(5, value.active_recordings)
        size += ProtoAdapter.STRING.encodedSizeWithTag(6, value.room_uuid)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: Room): Unit {
        if (value.room_id != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.room_id)
        if (value.title != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.title)
        ProtoAdapter.INSTANT.encodeWithTag(writer, 3, value.obsolete_created_at)
        if (value.created_at != 0L) ProtoAdapter.UINT64.encodeWithTag(writer, 4, value.created_at)
        ActiveRecording.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.active_recordings)
        ProtoAdapter.STRING.encodeWithTag(writer, 6, value.room_uuid)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: Room): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.STRING.encodeWithTag(writer, 6, value.room_uuid)
        ActiveRecording.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.active_recordings)
        if (value.created_at != 0L) ProtoAdapter.UINT64.encodeWithTag(writer, 4, value.created_at)
        ProtoAdapter.INSTANT.encodeWithTag(writer, 3, value.obsolete_created_at)
        if (value.title != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.title)
        if (value.room_id != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.room_id)
      }

      public override fun decode(reader: ProtoReader): Room {
        var room_id: String = ""
        var title: String = ""
        var obsolete_created_at: Instant? = null
        var created_at: Long = 0L
        val active_recordings = mutableListOf()
        var room_uuid: String? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> room_id = ProtoAdapter.STRING.decode(reader)
            2 -> title = ProtoAdapter.STRING.decode(reader)
            3 -> obsolete_created_at = ProtoAdapter.INSTANT.decode(reader)
            4 -> created_at = ProtoAdapter.UINT64.decode(reader)
            5 -> active_recordings.add(ActiveRecording.ADAPTER.decode(reader))
            6 -> room_uuid = ProtoAdapter.STRING.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return Room(
          room_id = room_id,
          title = title,
          obsolete_created_at = obsolete_created_at,
          created_at = created_at,
          active_recordings = active_recordings,
          room_uuid = room_uuid,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: Room): Room = value.copy(
        obsolete_created_at = value.obsolete_created_at?.let(ProtoAdapter.INSTANT::redact),
        active_recordings = value.active_recordings.redactElements(ActiveRecording.ADAPTER),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy