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

org.whispersystems.signalservice.internal.push.Content.kt Maven / Gradle / Ivy

There is a newer version: 2.15.3_unofficial_107
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: signalservice.Content in SignalService.proto
package org.whispersystems.signalservice.`internal`.push

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_2
import com.squareup.wire.WireField
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.jvm.JvmField
import okio.ByteString

public class Content(
  @field:WireField(
    tag = 1,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage#ADAPTER",
  )
  @JvmField
  public val dataMessage: DataMessage? = null,
  @field:WireField(
    tag = 2,
    adapter = "org.whispersystems.signalservice.internal.push.SyncMessage#ADAPTER",
  )
  @JvmField
  public val syncMessage: SyncMessage? = null,
  @field:WireField(
    tag = 3,
    adapter = "org.whispersystems.signalservice.internal.push.CallMessage#ADAPTER",
  )
  @JvmField
  public val callMessage: CallMessage? = null,
  @field:WireField(
    tag = 4,
    adapter = "org.whispersystems.signalservice.internal.push.NullMessage#ADAPTER",
  )
  @JvmField
  public val nullMessage: NullMessage? = null,
  @field:WireField(
    tag = 5,
    adapter = "org.whispersystems.signalservice.internal.push.ReceiptMessage#ADAPTER",
  )
  @JvmField
  public val receiptMessage: ReceiptMessage? = null,
  @field:WireField(
    tag = 6,
    adapter = "org.whispersystems.signalservice.internal.push.TypingMessage#ADAPTER",
  )
  @JvmField
  public val typingMessage: TypingMessage? = null,
  @field:WireField(
    tag = 7,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val senderKeyDistributionMessage: ByteString? = null,
  @field:WireField(
    tag = 8,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val decryptionErrorMessage: ByteString? = null,
  @field:WireField(
    tag = 9,
    adapter = "org.whispersystems.signalservice.internal.push.StoryMessage#ADAPTER",
  )
  @JvmField
  public val storyMessage: StoryMessage? = null,
  @field:WireField(
    tag = 10,
    adapter = "org.whispersystems.signalservice.internal.push.PniSignatureMessage#ADAPTER",
  )
  @JvmField
  public val pniSignatureMessage: PniSignatureMessage? = null,
  @field:WireField(
    tag = 11,
    adapter = "org.whispersystems.signalservice.internal.push.EditMessage#ADAPTER",
  )
  @JvmField
  public val editMessage: EditMessage? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.dataMessage = dataMessage
    builder.syncMessage = syncMessage
    builder.callMessage = callMessage
    builder.nullMessage = nullMessage
    builder.receiptMessage = receiptMessage
    builder.typingMessage = typingMessage
    builder.senderKeyDistributionMessage = senderKeyDistributionMessage
    builder.decryptionErrorMessage = decryptionErrorMessage
    builder.storyMessage = storyMessage
    builder.pniSignatureMessage = pniSignatureMessage
    builder.editMessage = editMessage
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is Content) return false
    if (unknownFields != other.unknownFields) return false
    if (dataMessage != other.dataMessage) return false
    if (syncMessage != other.syncMessage) return false
    if (callMessage != other.callMessage) return false
    if (nullMessage != other.nullMessage) return false
    if (receiptMessage != other.receiptMessage) return false
    if (typingMessage != other.typingMessage) return false
    if (senderKeyDistributionMessage != other.senderKeyDistributionMessage) return false
    if (decryptionErrorMessage != other.decryptionErrorMessage) return false
    if (storyMessage != other.storyMessage) return false
    if (pniSignatureMessage != other.pniSignatureMessage) return false
    if (editMessage != other.editMessage) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (dataMessage?.hashCode() ?: 0)
      result = result * 37 + (syncMessage?.hashCode() ?: 0)
      result = result * 37 + (callMessage?.hashCode() ?: 0)
      result = result * 37 + (nullMessage?.hashCode() ?: 0)
      result = result * 37 + (receiptMessage?.hashCode() ?: 0)
      result = result * 37 + (typingMessage?.hashCode() ?: 0)
      result = result * 37 + (senderKeyDistributionMessage?.hashCode() ?: 0)
      result = result * 37 + (decryptionErrorMessage?.hashCode() ?: 0)
      result = result * 37 + (storyMessage?.hashCode() ?: 0)
      result = result * 37 + (pniSignatureMessage?.hashCode() ?: 0)
      result = result * 37 + (editMessage?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (dataMessage != null) result += """dataMessage=$dataMessage"""
    if (syncMessage != null) result += """syncMessage=$syncMessage"""
    if (callMessage != null) result += """callMessage=$callMessage"""
    if (nullMessage != null) result += """nullMessage=$nullMessage"""
    if (receiptMessage != null) result += """receiptMessage=$receiptMessage"""
    if (typingMessage != null) result += """typingMessage=$typingMessage"""
    if (senderKeyDistributionMessage != null) result +=
        """senderKeyDistributionMessage=$senderKeyDistributionMessage"""
    if (decryptionErrorMessage != null) result +=
        """decryptionErrorMessage=$decryptionErrorMessage"""
    if (storyMessage != null) result += """storyMessage=$storyMessage"""
    if (pniSignatureMessage != null) result += """pniSignatureMessage=$pniSignatureMessage"""
    if (editMessage != null) result += """editMessage=$editMessage"""
    return result.joinToString(prefix = "Content{", separator = ", ", postfix = "}")
  }

  public fun copy(
    dataMessage: DataMessage? = this.dataMessage,
    syncMessage: SyncMessage? = this.syncMessage,
    callMessage: CallMessage? = this.callMessage,
    nullMessage: NullMessage? = this.nullMessage,
    receiptMessage: ReceiptMessage? = this.receiptMessage,
    typingMessage: TypingMessage? = this.typingMessage,
    senderKeyDistributionMessage: ByteString? = this.senderKeyDistributionMessage,
    decryptionErrorMessage: ByteString? = this.decryptionErrorMessage,
    storyMessage: StoryMessage? = this.storyMessage,
    pniSignatureMessage: PniSignatureMessage? = this.pniSignatureMessage,
    editMessage: EditMessage? = this.editMessage,
    unknownFields: ByteString = this.unknownFields,
  ): Content = Content(dataMessage, syncMessage, callMessage, nullMessage, receiptMessage,
      typingMessage, senderKeyDistributionMessage, decryptionErrorMessage, storyMessage,
      pniSignatureMessage, editMessage, unknownFields)

  public class Builder : Message.Builder() {
    @JvmField
    public var dataMessage: DataMessage? = null

    @JvmField
    public var syncMessage: SyncMessage? = null

    @JvmField
    public var callMessage: CallMessage? = null

    @JvmField
    public var nullMessage: NullMessage? = null

    @JvmField
    public var receiptMessage: ReceiptMessage? = null

    @JvmField
    public var typingMessage: TypingMessage? = null

    @JvmField
    public var senderKeyDistributionMessage: ByteString? = null

    @JvmField
    public var decryptionErrorMessage: ByteString? = null

    @JvmField
    public var storyMessage: StoryMessage? = null

    @JvmField
    public var pniSignatureMessage: PniSignatureMessage? = null

    @JvmField
    public var editMessage: EditMessage? = null

    public fun dataMessage(dataMessage: DataMessage?): Builder {
      this.dataMessage = dataMessage
      return this
    }

    public fun syncMessage(syncMessage: SyncMessage?): Builder {
      this.syncMessage = syncMessage
      return this
    }

    public fun callMessage(callMessage: CallMessage?): Builder {
      this.callMessage = callMessage
      return this
    }

    public fun nullMessage(nullMessage: NullMessage?): Builder {
      this.nullMessage = nullMessage
      return this
    }

    public fun receiptMessage(receiptMessage: ReceiptMessage?): Builder {
      this.receiptMessage = receiptMessage
      return this
    }

    public fun typingMessage(typingMessage: TypingMessage?): Builder {
      this.typingMessage = typingMessage
      return this
    }

    public fun senderKeyDistributionMessage(senderKeyDistributionMessage: ByteString?): Builder {
      this.senderKeyDistributionMessage = senderKeyDistributionMessage
      return this
    }

    public fun decryptionErrorMessage(decryptionErrorMessage: ByteString?): Builder {
      this.decryptionErrorMessage = decryptionErrorMessage
      return this
    }

    public fun storyMessage(storyMessage: StoryMessage?): Builder {
      this.storyMessage = storyMessage
      return this
    }

    public fun pniSignatureMessage(pniSignatureMessage: PniSignatureMessage?): Builder {
      this.pniSignatureMessage = pniSignatureMessage
      return this
    }

    public fun editMessage(editMessage: EditMessage?): Builder {
      this.editMessage = editMessage
      return this
    }

    public override fun build(): Content = Content(
      dataMessage = dataMessage,
      syncMessage = syncMessage,
      callMessage = callMessage,
      nullMessage = nullMessage,
      receiptMessage = receiptMessage,
      typingMessage = typingMessage,
      senderKeyDistributionMessage = senderKeyDistributionMessage,
      decryptionErrorMessage = decryptionErrorMessage,
      storyMessage = storyMessage,
      pniSignatureMessage = pniSignatureMessage,
      editMessage = editMessage,
      unknownFields = buildUnknownFields()
    )
  }

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      Content::class, 
      "type.googleapis.com/signalservice.Content", 
      PROTO_2, 
      null, 
      "SignalService.proto"
    ) {
      public override fun encodedSize(`value`: Content): Int {
        var size = value.unknownFields.size
        size += DataMessage.ADAPTER.encodedSizeWithTag(1, value.dataMessage)
        size += SyncMessage.ADAPTER.encodedSizeWithTag(2, value.syncMessage)
        size += CallMessage.ADAPTER.encodedSizeWithTag(3, value.callMessage)
        size += NullMessage.ADAPTER.encodedSizeWithTag(4, value.nullMessage)
        size += ReceiptMessage.ADAPTER.encodedSizeWithTag(5, value.receiptMessage)
        size += TypingMessage.ADAPTER.encodedSizeWithTag(6, value.typingMessage)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(7, value.senderKeyDistributionMessage)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(8, value.decryptionErrorMessage)
        size += StoryMessage.ADAPTER.encodedSizeWithTag(9, value.storyMessage)
        size += PniSignatureMessage.ADAPTER.encodedSizeWithTag(10, value.pniSignatureMessage)
        size += EditMessage.ADAPTER.encodedSizeWithTag(11, value.editMessage)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: Content): Unit {
        DataMessage.ADAPTER.encodeWithTag(writer, 1, value.dataMessage)
        SyncMessage.ADAPTER.encodeWithTag(writer, 2, value.syncMessage)
        CallMessage.ADAPTER.encodeWithTag(writer, 3, value.callMessage)
        NullMessage.ADAPTER.encodeWithTag(writer, 4, value.nullMessage)
        ReceiptMessage.ADAPTER.encodeWithTag(writer, 5, value.receiptMessage)
        TypingMessage.ADAPTER.encodeWithTag(writer, 6, value.typingMessage)
        ProtoAdapter.BYTES.encodeWithTag(writer, 7, value.senderKeyDistributionMessage)
        ProtoAdapter.BYTES.encodeWithTag(writer, 8, value.decryptionErrorMessage)
        StoryMessage.ADAPTER.encodeWithTag(writer, 9, value.storyMessage)
        PniSignatureMessage.ADAPTER.encodeWithTag(writer, 10, value.pniSignatureMessage)
        EditMessage.ADAPTER.encodeWithTag(writer, 11, value.editMessage)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: Content): Unit {
        writer.writeBytes(value.unknownFields)
        EditMessage.ADAPTER.encodeWithTag(writer, 11, value.editMessage)
        PniSignatureMessage.ADAPTER.encodeWithTag(writer, 10, value.pniSignatureMessage)
        StoryMessage.ADAPTER.encodeWithTag(writer, 9, value.storyMessage)
        ProtoAdapter.BYTES.encodeWithTag(writer, 8, value.decryptionErrorMessage)
        ProtoAdapter.BYTES.encodeWithTag(writer, 7, value.senderKeyDistributionMessage)
        TypingMessage.ADAPTER.encodeWithTag(writer, 6, value.typingMessage)
        ReceiptMessage.ADAPTER.encodeWithTag(writer, 5, value.receiptMessage)
        NullMessage.ADAPTER.encodeWithTag(writer, 4, value.nullMessage)
        CallMessage.ADAPTER.encodeWithTag(writer, 3, value.callMessage)
        SyncMessage.ADAPTER.encodeWithTag(writer, 2, value.syncMessage)
        DataMessage.ADAPTER.encodeWithTag(writer, 1, value.dataMessage)
      }

      public override fun decode(reader: ProtoReader): Content {
        var dataMessage: DataMessage? = null
        var syncMessage: SyncMessage? = null
        var callMessage: CallMessage? = null
        var nullMessage: NullMessage? = null
        var receiptMessage: ReceiptMessage? = null
        var typingMessage: TypingMessage? = null
        var senderKeyDistributionMessage: ByteString? = null
        var decryptionErrorMessage: ByteString? = null
        var storyMessage: StoryMessage? = null
        var pniSignatureMessage: PniSignatureMessage? = null
        var editMessage: EditMessage? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> dataMessage = DataMessage.ADAPTER.decode(reader)
            2 -> syncMessage = SyncMessage.ADAPTER.decode(reader)
            3 -> callMessage = CallMessage.ADAPTER.decode(reader)
            4 -> nullMessage = NullMessage.ADAPTER.decode(reader)
            5 -> receiptMessage = ReceiptMessage.ADAPTER.decode(reader)
            6 -> typingMessage = TypingMessage.ADAPTER.decode(reader)
            7 -> senderKeyDistributionMessage = ProtoAdapter.BYTES.decode(reader)
            8 -> decryptionErrorMessage = ProtoAdapter.BYTES.decode(reader)
            9 -> storyMessage = StoryMessage.ADAPTER.decode(reader)
            10 -> pniSignatureMessage = PniSignatureMessage.ADAPTER.decode(reader)
            11 -> editMessage = EditMessage.ADAPTER.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return Content(
          dataMessage = dataMessage,
          syncMessage = syncMessage,
          callMessage = callMessage,
          nullMessage = nullMessage,
          receiptMessage = receiptMessage,
          typingMessage = typingMessage,
          senderKeyDistributionMessage = senderKeyDistributionMessage,
          decryptionErrorMessage = decryptionErrorMessage,
          storyMessage = storyMessage,
          pniSignatureMessage = pniSignatureMessage,
          editMessage = editMessage,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: Content): Content = value.copy(
        dataMessage = value.dataMessage?.let(DataMessage.ADAPTER::redact),
        syncMessage = value.syncMessage?.let(SyncMessage.ADAPTER::redact),
        callMessage = value.callMessage?.let(CallMessage.ADAPTER::redact),
        nullMessage = value.nullMessage?.let(NullMessage.ADAPTER::redact),
        receiptMessage = value.receiptMessage?.let(ReceiptMessage.ADAPTER::redact),
        typingMessage = value.typingMessage?.let(TypingMessage.ADAPTER::redact),
        storyMessage = value.storyMessage?.let(StoryMessage.ADAPTER::redact),
        pniSignatureMessage = value.pniSignatureMessage?.let(PniSignatureMessage.ADAPTER::redact),
        editMessage = value.editMessage?.let(EditMessage.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy