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

commonMain.socket.chat.SendChatMessageToPeersRequest.kt Maven / Gradle / Ivy

// Code generated by Wire protocol buffer compiler, do not edit.
// Source: socket.chat.SendChatMessageToPeersRequest in socket/chat.proto
package socket.chat

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 SendChatMessageToPeersRequest(
  peer_ids: List = emptyList(),
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#INT32",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "payloadType",
  )
  public val payload_type: Int = 0,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
  )
  public val payload: String = "",
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.REPEATED,
    jsonName = "peerIds",
  )
  public val peer_ids: List = immutableCopyOf("peer_ids", peer_ids)

  @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 SendChatMessageToPeersRequest) return false
    if (unknownFields != other.unknownFields) return false
    if (peer_ids != other.peer_ids) return false
    if (payload_type != other.payload_type) return false
    if (payload != other.payload) return false
    return true
  }

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

  public override fun toString(): String {
    val result = mutableListOf()
    if (peer_ids.isNotEmpty()) result += """peer_ids=${sanitize(peer_ids)}"""
    result += """payload_type=$payload_type"""
    result += """payload=${sanitize(payload)}"""
    return result.joinToString(prefix = "SendChatMessageToPeersRequest{", separator = ", ", postfix
        = "}")
  }

  public fun copy(
    peer_ids: List = this.peer_ids,
    payload_type: Int = this.payload_type,
    payload: String = this.payload,
    unknownFields: ByteString = this.unknownFields,
  ): SendChatMessageToPeersRequest = SendChatMessageToPeersRequest(peer_ids, payload_type, payload,
      unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object :
        ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      SendChatMessageToPeersRequest::class, 
      "type.googleapis.com/socket.chat.SendChatMessageToPeersRequest", 
      PROTO_3, 
      null, 
      "socket/chat.proto"
    ) {
      public override fun encodedSize(`value`: SendChatMessageToPeersRequest): Int {
        var size = value.unknownFields.size
        size += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(1, value.peer_ids)
        if (value.payload_type != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(2,
            value.payload_type)
        if (value.payload != "") size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.payload)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: SendChatMessageToPeersRequest):
          Unit {
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1, value.peer_ids)
        if (value.payload_type != 0) ProtoAdapter.INT32.encodeWithTag(writer, 2, value.payload_type)
        if (value.payload != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.payload)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter,
          `value`: SendChatMessageToPeersRequest): Unit {
        writer.writeBytes(value.unknownFields)
        if (value.payload != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.payload)
        if (value.payload_type != 0) ProtoAdapter.INT32.encodeWithTag(writer, 2, value.payload_type)
        ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 1, value.peer_ids)
      }

      public override fun decode(reader: ProtoReader): SendChatMessageToPeersRequest {
        val peer_ids = mutableListOf()
        var payload_type: Int = 0
        var payload: String = ""
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> peer_ids.add(ProtoAdapter.STRING.decode(reader))
            2 -> payload_type = ProtoAdapter.INT32.decode(reader)
            3 -> payload = ProtoAdapter.STRING.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return SendChatMessageToPeersRequest(
          peer_ids = peer_ids,
          payload_type = payload_type,
          payload = payload,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy