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

commonMain.media.edge.PeerJoinCompleteResponse.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: media.edge.PeerJoinCompleteResponse in media/client_edge.proto
package media.edge

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`.redactElements
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 PeerJoinCompleteResponse(
  @field:WireField(
    tag = 1,
    adapter = "media.edge.GetRoomStateResponse#ADAPTER",
    jsonName = "roomState",
  )
  public val room_state: GetRoomStateResponse? = null,
  participants: List = emptyList(),
  @field:WireField(
    tag = 3,
    adapter = "media.edge.SelectedPeersResponse#ADAPTER",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "selectedPeers",
  )
  public val selected_peers: SelectedPeersResponse? = null,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "maxPreferredStreams",
  )
  public val max_preferred_streams: Int = 0,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 2,
    adapter = "media.edge.RoomParticipants#ADAPTER",
    label = WireField.Label.REPEATED,
  )
  public val participants: List = immutableCopyOf("participants", participants)

  @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 PeerJoinCompleteResponse) return false
    if (unknownFields != other.unknownFields) return false
    if (room_state != other.room_state) return false
    if (participants != other.participants) return false
    if (selected_peers != other.selected_peers) return false
    if (max_preferred_streams != other.max_preferred_streams) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (room_state?.hashCode() ?: 0)
      result = result * 37 + participants.hashCode()
      result = result * 37 + (selected_peers?.hashCode() ?: 0)
      result = result * 37 + max_preferred_streams.hashCode()
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (room_state != null) result += """room_state=$room_state"""
    if (participants.isNotEmpty()) result += """participants=$participants"""
    if (selected_peers != null) result += """selected_peers=$selected_peers"""
    result += """max_preferred_streams=$max_preferred_streams"""
    return result.joinToString(prefix = "PeerJoinCompleteResponse{", separator = ", ", postfix =
        "}")
  }

  public fun copy(
    room_state: GetRoomStateResponse? = this.room_state,
    participants: List = this.participants,
    selected_peers: SelectedPeersResponse? = this.selected_peers,
    max_preferred_streams: Int = this.max_preferred_streams,
    unknownFields: ByteString = this.unknownFields,
  ): PeerJoinCompleteResponse = PeerJoinCompleteResponse(room_state, participants, selected_peers,
      max_preferred_streams, unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object :
        ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      PeerJoinCompleteResponse::class, 
      "type.googleapis.com/media.edge.PeerJoinCompleteResponse", 
      PROTO_3, 
      null, 
      "media/client_edge.proto"
    ) {
      public override fun encodedSize(`value`: PeerJoinCompleteResponse): Int {
        var size = value.unknownFields.size
        size += GetRoomStateResponse.ADAPTER.encodedSizeWithTag(1, value.room_state)
        size += RoomParticipants.ADAPTER.asRepeated().encodedSizeWithTag(2, value.participants)
        if (value.selected_peers != null) size +=
            SelectedPeersResponse.ADAPTER.encodedSizeWithTag(3, value.selected_peers)
        if (value.max_preferred_streams != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(4,
            value.max_preferred_streams)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: PeerJoinCompleteResponse): Unit {
        GetRoomStateResponse.ADAPTER.encodeWithTag(writer, 1, value.room_state)
        RoomParticipants.ADAPTER.asRepeated().encodeWithTag(writer, 2, value.participants)
        if (value.selected_peers != null) SelectedPeersResponse.ADAPTER.encodeWithTag(writer, 3,
            value.selected_peers)
        if (value.max_preferred_streams != 0) ProtoAdapter.INT32.encodeWithTag(writer, 4,
            value.max_preferred_streams)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: PeerJoinCompleteResponse):
          Unit {
        writer.writeBytes(value.unknownFields)
        if (value.max_preferred_streams != 0) ProtoAdapter.INT32.encodeWithTag(writer, 4,
            value.max_preferred_streams)
        if (value.selected_peers != null) SelectedPeersResponse.ADAPTER.encodeWithTag(writer, 3,
            value.selected_peers)
        RoomParticipants.ADAPTER.asRepeated().encodeWithTag(writer, 2, value.participants)
        GetRoomStateResponse.ADAPTER.encodeWithTag(writer, 1, value.room_state)
      }

      public override fun decode(reader: ProtoReader): PeerJoinCompleteResponse {
        var room_state: GetRoomStateResponse? = null
        val participants = mutableListOf()
        var selected_peers: SelectedPeersResponse? = null
        var max_preferred_streams: Int = 0
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> room_state = GetRoomStateResponse.ADAPTER.decode(reader)
            2 -> participants.add(RoomParticipants.ADAPTER.decode(reader))
            3 -> selected_peers = SelectedPeersResponse.ADAPTER.decode(reader)
            4 -> max_preferred_streams = ProtoAdapter.INT32.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return PeerJoinCompleteResponse(
          room_state = room_state,
          participants = participants,
          selected_peers = selected_peers,
          max_preferred_streams = max_preferred_streams,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: PeerJoinCompleteResponse): PeerJoinCompleteResponse =
          value.copy(
        room_state = value.room_state?.let(GetRoomStateResponse.ADAPTER::redact),
        participants = value.participants.redactElements(RoomParticipants.ADAPTER),
        selected_peers = value.selected_peers?.let(SelectedPeersResponse.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy