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

org.whispersystems.signalservice.internal.push.DataMessage.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.DataMessage in SignalService.proto
package org.whispersystems.signalservice.`internal`.push

import com.squareup.wire.EnumAdapter
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
import com.squareup.wire.Syntax.PROTO_2
import com.squareup.wire.WireEnum
import com.squareup.wire.WireField
import com.squareup.wire.`internal`.checkElementsNotNull
import com.squareup.wire.`internal`.countNonDefa
import com.squareup.wire.`internal`.immutableCopyOf
import com.squareup.wire.`internal`.redactElements
import com.squareup.wire.`internal`.sanitize
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmField
import kotlin.jvm.JvmStatic
import okio.ByteString

public class DataMessage(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
  )
  @JvmField
  public val body: String? = null,
  attachments: List = emptyList(),
  @field:WireField(
    tag = 3,
    adapter = "org.whispersystems.signalservice.internal.push.GroupContext#ADAPTER",
  )
  @JvmField
  public val group: GroupContext? = null,
  @field:WireField(
    tag = 15,
    adapter = "org.whispersystems.signalservice.internal.push.GroupContextV2#ADAPTER",
  )
  @JvmField
  public val groupV2: GroupContextV2? = null,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#UINT32",
  )
  @JvmField
  public val flags: Int? = null,
  @field:WireField(
    tag = 5,
    adapter = "com.squareup.wire.ProtoAdapter#UINT32",
  )
  @JvmField
  public val expireTimer: Int? = null,
  @field:WireField(
    tag = 6,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val profileKey: ByteString? = null,
  @field:WireField(
    tag = 7,
    adapter = "com.squareup.wire.ProtoAdapter#UINT64",
  )
  @JvmField
  public val timestamp: Long? = null,
  @field:WireField(
    tag = 8,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Quote#ADAPTER",
  )
  @JvmField
  public val quote: Quote? = null,
  contact: List = emptyList(),
  preview: List = emptyList(),
  @field:WireField(
    tag = 11,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Sticker#ADAPTER",
  )
  @JvmField
  public val sticker: Sticker? = null,
  @field:WireField(
    tag = 12,
    adapter = "com.squareup.wire.ProtoAdapter#UINT32",
  )
  @JvmField
  public val requiredProtocolVersion: Int? = null,
  @field:WireField(
    tag = 14,
    adapter = "com.squareup.wire.ProtoAdapter#BOOL",
  )
  @JvmField
  public val isViewOnce: Boolean? = null,
  @field:WireField(
    tag = 16,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Reaction#ADAPTER",
  )
  @JvmField
  public val reaction: Reaction? = null,
  @field:WireField(
    tag = 17,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Delete#ADAPTER",
  )
  @JvmField
  public val delete: Delete? = null,
  bodyRanges: List = emptyList(),
  @field:WireField(
    tag = 19,
    adapter =
        "org.whispersystems.signalservice.internal.push.DataMessage${'$'}GroupCallUpdate#ADAPTER",
  )
  @JvmField
  public val groupCallUpdate: GroupCallUpdate? = null,
  @field:WireField(
    tag = 20,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Payment#ADAPTER",
  )
  @JvmField
  public val payment: Payment? = null,
  @field:WireField(
    tag = 21,
    adapter =
        "org.whispersystems.signalservice.internal.push.DataMessage${'$'}StoryContext#ADAPTER",
  )
  @JvmField
  public val storyContext: StoryContext? = null,
  @field:WireField(
    tag = 22,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage${'$'}GiftBadge#ADAPTER",
  )
  @JvmField
  public val giftBadge: GiftBadge? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @field:WireField(
    tag = 2,
    adapter = "org.whispersystems.signalservice.internal.push.AttachmentPointer#ADAPTER",
    label = WireField.Label.REPEATED,
  )
  @JvmField
  public val attachments: List = immutableCopyOf("attachments", attachments)

  @field:WireField(
    tag = 9,
    adapter = "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact#ADAPTER",
    label = WireField.Label.REPEATED,
  )
  @JvmField
  public val contact: List = immutableCopyOf("contact", contact)

  @field:WireField(
    tag = 10,
    adapter = "org.whispersystems.signalservice.internal.push.Preview#ADAPTER",
    label = WireField.Label.REPEATED,
  )
  @JvmField
  public val preview: List = immutableCopyOf("preview", preview)

  @field:WireField(
    tag = 18,
    adapter = "org.whispersystems.signalservice.internal.push.BodyRange#ADAPTER",
    label = WireField.Label.REPEATED,
  )
  @JvmField
  public val bodyRanges: List = immutableCopyOf("bodyRanges", bodyRanges)

  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.body = body
    builder.attachments = attachments
    builder.group = group
    builder.groupV2 = groupV2
    builder.flags = flags
    builder.expireTimer = expireTimer
    builder.profileKey = profileKey
    builder.timestamp = timestamp
    builder.quote = quote
    builder.contact = contact
    builder.preview = preview
    builder.sticker = sticker
    builder.requiredProtocolVersion = requiredProtocolVersion
    builder.isViewOnce = isViewOnce
    builder.reaction = reaction
    builder.delete = delete
    builder.bodyRanges = bodyRanges
    builder.groupCallUpdate = groupCallUpdate
    builder.payment = payment
    builder.storyContext = storyContext
    builder.giftBadge = giftBadge
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is DataMessage) return false
    if (unknownFields != other.unknownFields) return false
    if (body != other.body) return false
    if (attachments != other.attachments) return false
    if (group != other.group) return false
    if (groupV2 != other.groupV2) return false
    if (flags != other.flags) return false
    if (expireTimer != other.expireTimer) return false
    if (profileKey != other.profileKey) return false
    if (timestamp != other.timestamp) return false
    if (quote != other.quote) return false
    if (contact != other.contact) return false
    if (preview != other.preview) return false
    if (sticker != other.sticker) return false
    if (requiredProtocolVersion != other.requiredProtocolVersion) return false
    if (isViewOnce != other.isViewOnce) return false
    if (reaction != other.reaction) return false
    if (delete != other.delete) return false
    if (bodyRanges != other.bodyRanges) return false
    if (groupCallUpdate != other.groupCallUpdate) return false
    if (payment != other.payment) return false
    if (storyContext != other.storyContext) return false
    if (giftBadge != other.giftBadge) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (body?.hashCode() ?: 0)
      result = result * 37 + attachments.hashCode()
      result = result * 37 + (group?.hashCode() ?: 0)
      result = result * 37 + (groupV2?.hashCode() ?: 0)
      result = result * 37 + (flags?.hashCode() ?: 0)
      result = result * 37 + (expireTimer?.hashCode() ?: 0)
      result = result * 37 + (profileKey?.hashCode() ?: 0)
      result = result * 37 + (timestamp?.hashCode() ?: 0)
      result = result * 37 + (quote?.hashCode() ?: 0)
      result = result * 37 + contact.hashCode()
      result = result * 37 + preview.hashCode()
      result = result * 37 + (sticker?.hashCode() ?: 0)
      result = result * 37 + (requiredProtocolVersion?.hashCode() ?: 0)
      result = result * 37 + (isViewOnce?.hashCode() ?: 0)
      result = result * 37 + (reaction?.hashCode() ?: 0)
      result = result * 37 + (delete?.hashCode() ?: 0)
      result = result * 37 + bodyRanges.hashCode()
      result = result * 37 + (groupCallUpdate?.hashCode() ?: 0)
      result = result * 37 + (payment?.hashCode() ?: 0)
      result = result * 37 + (storyContext?.hashCode() ?: 0)
      result = result * 37 + (giftBadge?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (body != null) result += """body=${sanitize(body)}"""
    if (attachments.isNotEmpty()) result += """attachments=$attachments"""
    if (group != null) result += """group=$group"""
    if (groupV2 != null) result += """groupV2=$groupV2"""
    if (flags != null) result += """flags=$flags"""
    if (expireTimer != null) result += """expireTimer=$expireTimer"""
    if (profileKey != null) result += """profileKey=$profileKey"""
    if (timestamp != null) result += """timestamp=$timestamp"""
    if (quote != null) result += """quote=$quote"""
    if (contact.isNotEmpty()) result += """contact=$contact"""
    if (preview.isNotEmpty()) result += """preview=$preview"""
    if (sticker != null) result += """sticker=$sticker"""
    if (requiredProtocolVersion != null) result +=
        """requiredProtocolVersion=$requiredProtocolVersion"""
    if (isViewOnce != null) result += """isViewOnce=$isViewOnce"""
    if (reaction != null) result += """reaction=$reaction"""
    if (delete != null) result += """delete=$delete"""
    if (bodyRanges.isNotEmpty()) result += """bodyRanges=$bodyRanges"""
    if (groupCallUpdate != null) result += """groupCallUpdate=$groupCallUpdate"""
    if (payment != null) result += """payment=$payment"""
    if (storyContext != null) result += """storyContext=$storyContext"""
    if (giftBadge != null) result += """giftBadge=$giftBadge"""
    return result.joinToString(prefix = "DataMessage{", separator = ", ", postfix = "}")
  }

  public fun copy(
    body: String? = this.body,
    attachments: List = this.attachments,
    group: GroupContext? = this.group,
    groupV2: GroupContextV2? = this.groupV2,
    flags: Int? = this.flags,
    expireTimer: Int? = this.expireTimer,
    profileKey: ByteString? = this.profileKey,
    timestamp: Long? = this.timestamp,
    quote: Quote? = this.quote,
    contact: List = this.contact,
    preview: List = this.preview,
    sticker: Sticker? = this.sticker,
    requiredProtocolVersion: Int? = this.requiredProtocolVersion,
    isViewOnce: Boolean? = this.isViewOnce,
    reaction: Reaction? = this.reaction,
    delete: Delete? = this.delete,
    bodyRanges: List = this.bodyRanges,
    groupCallUpdate: GroupCallUpdate? = this.groupCallUpdate,
    payment: Payment? = this.payment,
    storyContext: StoryContext? = this.storyContext,
    giftBadge: GiftBadge? = this.giftBadge,
    unknownFields: ByteString = this.unknownFields,
  ): DataMessage = DataMessage(body, attachments, group, groupV2, flags, expireTimer, profileKey,
      timestamp, quote, contact, preview, sticker, requiredProtocolVersion, isViewOnce, reaction,
      delete, bodyRanges, groupCallUpdate, payment, storyContext, giftBadge, unknownFields)

  public class Builder : Message.Builder() {
    @JvmField
    public var body: String? = null

    @JvmField
    public var attachments: List = emptyList()

    @JvmField
    public var group: GroupContext? = null

    @JvmField
    public var groupV2: GroupContextV2? = null

    @JvmField
    public var flags: Int? = null

    @JvmField
    public var expireTimer: Int? = null

    @JvmField
    public var profileKey: ByteString? = null

    @JvmField
    public var timestamp: Long? = null

    @JvmField
    public var quote: Quote? = null

    @JvmField
    public var contact: List = emptyList()

    @JvmField
    public var preview: List = emptyList()

    @JvmField
    public var sticker: Sticker? = null

    @JvmField
    public var requiredProtocolVersion: Int? = null

    @JvmField
    public var isViewOnce: Boolean? = null

    @JvmField
    public var reaction: Reaction? = null

    @JvmField
    public var delete: Delete? = null

    @JvmField
    public var bodyRanges: List = emptyList()

    @JvmField
    public var groupCallUpdate: GroupCallUpdate? = null

    @JvmField
    public var payment: Payment? = null

    @JvmField
    public var storyContext: StoryContext? = null

    @JvmField
    public var giftBadge: GiftBadge? = null

    public fun body(body: String?): Builder {
      this.body = body
      return this
    }

    public fun attachments(attachments: List): Builder {
      checkElementsNotNull(attachments)
      this.attachments = attachments
      return this
    }

    public fun group(group: GroupContext?): Builder {
      this.group = group
      return this
    }

    public fun groupV2(groupV2: GroupContextV2?): Builder {
      this.groupV2 = groupV2
      return this
    }

    public fun flags(flags: Int?): Builder {
      this.flags = flags
      return this
    }

    public fun expireTimer(expireTimer: Int?): Builder {
      this.expireTimer = expireTimer
      return this
    }

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

    public fun timestamp(timestamp: Long?): Builder {
      this.timestamp = timestamp
      return this
    }

    public fun quote(quote: Quote?): Builder {
      this.quote = quote
      return this
    }

    public fun contact(contact: List): Builder {
      checkElementsNotNull(contact)
      this.contact = contact
      return this
    }

    public fun preview(preview: List): Builder {
      checkElementsNotNull(preview)
      this.preview = preview
      return this
    }

    public fun sticker(sticker: Sticker?): Builder {
      this.sticker = sticker
      return this
    }

    public fun requiredProtocolVersion(requiredProtocolVersion: Int?): Builder {
      this.requiredProtocolVersion = requiredProtocolVersion
      return this
    }

    public fun isViewOnce(isViewOnce: Boolean?): Builder {
      this.isViewOnce = isViewOnce
      return this
    }

    public fun reaction(reaction: Reaction?): Builder {
      this.reaction = reaction
      return this
    }

    public fun delete(delete: Delete?): Builder {
      this.delete = delete
      return this
    }

    public fun bodyRanges(bodyRanges: List): Builder {
      checkElementsNotNull(bodyRanges)
      this.bodyRanges = bodyRanges
      return this
    }

    public fun groupCallUpdate(groupCallUpdate: GroupCallUpdate?): Builder {
      this.groupCallUpdate = groupCallUpdate
      return this
    }

    public fun payment(payment: Payment?): Builder {
      this.payment = payment
      return this
    }

    public fun storyContext(storyContext: StoryContext?): Builder {
      this.storyContext = storyContext
      return this
    }

    public fun giftBadge(giftBadge: GiftBadge?): Builder {
      this.giftBadge = giftBadge
      return this
    }

    public override fun build(): DataMessage = DataMessage(
      body = body,
      attachments = attachments,
      group = group,
      groupV2 = groupV2,
      flags = flags,
      expireTimer = expireTimer,
      profileKey = profileKey,
      timestamp = timestamp,
      quote = quote,
      contact = contact,
      preview = preview,
      sticker = sticker,
      requiredProtocolVersion = requiredProtocolVersion,
      isViewOnce = isViewOnce,
      reaction = reaction,
      delete = delete,
      bodyRanges = bodyRanges,
      groupCallUpdate = groupCallUpdate,
      payment = payment,
      storyContext = storyContext,
      giftBadge = giftBadge,
      unknownFields = buildUnknownFields()
    )
  }

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      DataMessage::class, 
      "type.googleapis.com/signalservice.DataMessage", 
      PROTO_2, 
      null, 
      "SignalService.proto"
    ) {
      public override fun encodedSize(`value`: DataMessage): Int {
        var size = value.unknownFields.size
        size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.body)
        size += AttachmentPointer.ADAPTER.asRepeated().encodedSizeWithTag(2, value.attachments)
        size += GroupContext.ADAPTER.encodedSizeWithTag(3, value.group)
        size += GroupContextV2.ADAPTER.encodedSizeWithTag(15, value.groupV2)
        size += ProtoAdapter.UINT32.encodedSizeWithTag(4, value.flags)
        size += ProtoAdapter.UINT32.encodedSizeWithTag(5, value.expireTimer)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(6, value.profileKey)
        size += ProtoAdapter.UINT64.encodedSizeWithTag(7, value.timestamp)
        size += Quote.ADAPTER.encodedSizeWithTag(8, value.quote)
        size += Contact.ADAPTER.asRepeated().encodedSizeWithTag(9, value.contact)
        size += Preview.ADAPTER.asRepeated().encodedSizeWithTag(10, value.preview)
        size += Sticker.ADAPTER.encodedSizeWithTag(11, value.sticker)
        size += ProtoAdapter.UINT32.encodedSizeWithTag(12, value.requiredProtocolVersion)
        size += ProtoAdapter.BOOL.encodedSizeWithTag(14, value.isViewOnce)
        size += Reaction.ADAPTER.encodedSizeWithTag(16, value.reaction)
        size += Delete.ADAPTER.encodedSizeWithTag(17, value.delete)
        size += BodyRange.ADAPTER.asRepeated().encodedSizeWithTag(18, value.bodyRanges)
        size += GroupCallUpdate.ADAPTER.encodedSizeWithTag(19, value.groupCallUpdate)
        size += Payment.ADAPTER.encodedSizeWithTag(20, value.payment)
        size += StoryContext.ADAPTER.encodedSizeWithTag(21, value.storyContext)
        size += GiftBadge.ADAPTER.encodedSizeWithTag(22, value.giftBadge)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: DataMessage): Unit {
        ProtoAdapter.STRING.encodeWithTag(writer, 1, value.body)
        AttachmentPointer.ADAPTER.asRepeated().encodeWithTag(writer, 2, value.attachments)
        GroupContext.ADAPTER.encodeWithTag(writer, 3, value.group)
        GroupContextV2.ADAPTER.encodeWithTag(writer, 15, value.groupV2)
        ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.flags)
        ProtoAdapter.UINT32.encodeWithTag(writer, 5, value.expireTimer)
        ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.profileKey)
        ProtoAdapter.UINT64.encodeWithTag(writer, 7, value.timestamp)
        Quote.ADAPTER.encodeWithTag(writer, 8, value.quote)
        Contact.ADAPTER.asRepeated().encodeWithTag(writer, 9, value.contact)
        Preview.ADAPTER.asRepeated().encodeWithTag(writer, 10, value.preview)
        Sticker.ADAPTER.encodeWithTag(writer, 11, value.sticker)
        ProtoAdapter.UINT32.encodeWithTag(writer, 12, value.requiredProtocolVersion)
        ProtoAdapter.BOOL.encodeWithTag(writer, 14, value.isViewOnce)
        Reaction.ADAPTER.encodeWithTag(writer, 16, value.reaction)
        Delete.ADAPTER.encodeWithTag(writer, 17, value.delete)
        BodyRange.ADAPTER.asRepeated().encodeWithTag(writer, 18, value.bodyRanges)
        GroupCallUpdate.ADAPTER.encodeWithTag(writer, 19, value.groupCallUpdate)
        Payment.ADAPTER.encodeWithTag(writer, 20, value.payment)
        StoryContext.ADAPTER.encodeWithTag(writer, 21, value.storyContext)
        GiftBadge.ADAPTER.encodeWithTag(writer, 22, value.giftBadge)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: DataMessage): Unit {
        writer.writeBytes(value.unknownFields)
        GiftBadge.ADAPTER.encodeWithTag(writer, 22, value.giftBadge)
        StoryContext.ADAPTER.encodeWithTag(writer, 21, value.storyContext)
        Payment.ADAPTER.encodeWithTag(writer, 20, value.payment)
        GroupCallUpdate.ADAPTER.encodeWithTag(writer, 19, value.groupCallUpdate)
        BodyRange.ADAPTER.asRepeated().encodeWithTag(writer, 18, value.bodyRanges)
        Delete.ADAPTER.encodeWithTag(writer, 17, value.delete)
        Reaction.ADAPTER.encodeWithTag(writer, 16, value.reaction)
        ProtoAdapter.BOOL.encodeWithTag(writer, 14, value.isViewOnce)
        ProtoAdapter.UINT32.encodeWithTag(writer, 12, value.requiredProtocolVersion)
        Sticker.ADAPTER.encodeWithTag(writer, 11, value.sticker)
        Preview.ADAPTER.asRepeated().encodeWithTag(writer, 10, value.preview)
        Contact.ADAPTER.asRepeated().encodeWithTag(writer, 9, value.contact)
        Quote.ADAPTER.encodeWithTag(writer, 8, value.quote)
        ProtoAdapter.UINT64.encodeWithTag(writer, 7, value.timestamp)
        ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.profileKey)
        ProtoAdapter.UINT32.encodeWithTag(writer, 5, value.expireTimer)
        ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.flags)
        GroupContextV2.ADAPTER.encodeWithTag(writer, 15, value.groupV2)
        GroupContext.ADAPTER.encodeWithTag(writer, 3, value.group)
        AttachmentPointer.ADAPTER.asRepeated().encodeWithTag(writer, 2, value.attachments)
        ProtoAdapter.STRING.encodeWithTag(writer, 1, value.body)
      }

      public override fun decode(reader: ProtoReader): DataMessage {
        var body: String? = null
        val attachments = mutableListOf()
        var group: GroupContext? = null
        var groupV2: GroupContextV2? = null
        var flags: Int? = null
        var expireTimer: Int? = null
        var profileKey: ByteString? = null
        var timestamp: Long? = null
        var quote: Quote? = null
        val contact = mutableListOf()
        val preview = mutableListOf()
        var sticker: Sticker? = null
        var requiredProtocolVersion: Int? = null
        var isViewOnce: Boolean? = null
        var reaction: Reaction? = null
        var delete: Delete? = null
        val bodyRanges = mutableListOf()
        var groupCallUpdate: GroupCallUpdate? = null
        var payment: Payment? = null
        var storyContext: StoryContext? = null
        var giftBadge: GiftBadge? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> body = ProtoAdapter.STRING.decode(reader)
            2 -> attachments.add(AttachmentPointer.ADAPTER.decode(reader))
            3 -> group = GroupContext.ADAPTER.decode(reader)
            15 -> groupV2 = GroupContextV2.ADAPTER.decode(reader)
            4 -> flags = ProtoAdapter.UINT32.decode(reader)
            5 -> expireTimer = ProtoAdapter.UINT32.decode(reader)
            6 -> profileKey = ProtoAdapter.BYTES.decode(reader)
            7 -> timestamp = ProtoAdapter.UINT64.decode(reader)
            8 -> quote = Quote.ADAPTER.decode(reader)
            9 -> contact.add(Contact.ADAPTER.decode(reader))
            10 -> preview.add(Preview.ADAPTER.decode(reader))
            11 -> sticker = Sticker.ADAPTER.decode(reader)
            12 -> requiredProtocolVersion = ProtoAdapter.UINT32.decode(reader)
            14 -> isViewOnce = ProtoAdapter.BOOL.decode(reader)
            16 -> reaction = Reaction.ADAPTER.decode(reader)
            17 -> delete = Delete.ADAPTER.decode(reader)
            18 -> bodyRanges.add(BodyRange.ADAPTER.decode(reader))
            19 -> groupCallUpdate = GroupCallUpdate.ADAPTER.decode(reader)
            20 -> payment = Payment.ADAPTER.decode(reader)
            21 -> storyContext = StoryContext.ADAPTER.decode(reader)
            22 -> giftBadge = GiftBadge.ADAPTER.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return DataMessage(
          body = body,
          attachments = attachments,
          group = group,
          groupV2 = groupV2,
          flags = flags,
          expireTimer = expireTimer,
          profileKey = profileKey,
          timestamp = timestamp,
          quote = quote,
          contact = contact,
          preview = preview,
          sticker = sticker,
          requiredProtocolVersion = requiredProtocolVersion,
          isViewOnce = isViewOnce,
          reaction = reaction,
          delete = delete,
          bodyRanges = bodyRanges,
          groupCallUpdate = groupCallUpdate,
          payment = payment,
          storyContext = storyContext,
          giftBadge = giftBadge,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: DataMessage): DataMessage = value.copy(
        attachments = value.attachments.redactElements(AttachmentPointer.ADAPTER),
        group = value.group?.let(GroupContext.ADAPTER::redact),
        groupV2 = value.groupV2?.let(GroupContextV2.ADAPTER::redact),
        quote = value.quote?.let(Quote.ADAPTER::redact),
        contact = value.contact.redactElements(Contact.ADAPTER),
        preview = value.preview.redactElements(Preview.ADAPTER),
        sticker = value.sticker?.let(Sticker.ADAPTER::redact),
        reaction = value.reaction?.let(Reaction.ADAPTER::redact),
        delete = value.delete?.let(Delete.ADAPTER::redact),
        bodyRanges = value.bodyRanges.redactElements(BodyRange.ADAPTER),
        groupCallUpdate = value.groupCallUpdate?.let(GroupCallUpdate.ADAPTER::redact),
        payment = value.payment?.let(Payment.ADAPTER::redact),
        storyContext = value.storyContext?.let(StoryContext.ADAPTER::redact),
        giftBadge = value.giftBadge?.let(GiftBadge.ADAPTER::redact),
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }

  public enum class Flags(
    public override val `value`: Int,
  ) : WireEnum {
    END_SESSION(1),
    EXPIRATION_TIMER_UPDATE(2),
    PROFILE_KEY_UPDATE(4),
    ;

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : EnumAdapter(
        Flags::class, 
        PROTO_2, 
        null
      ) {
        public override fun fromValue(`value`: Int): Flags? = Flags.fromValue(value)
      }

      @JvmStatic
      public fun fromValue(`value`: Int): Flags? = when (value) {
        1 -> END_SESSION
        2 -> EXPIRATION_TIMER_UPDATE
        4 -> PROFILE_KEY_UPDATE
        else -> null
      }
    }
  }

  public class Quote(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
    )
    @JvmField
    public val id: Long? = null,
    @field:WireField(
      tag = 5,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val authorAci: String? = null,
    @field:WireField(
      tag = 3,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val text: String? = null,
    attachments: List = emptyList(),
    bodyRanges: List = emptyList(),
    @field:WireField(
      tag = 7,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Quote${'$'}Type#ADAPTER",
    )
    @JvmField
    public val type: Type? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    @field:WireField(
      tag = 4,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Quote${'$'}QuotedAttachment#ADAPTER",
      label = WireField.Label.REPEATED,
    )
    @JvmField
    public val attachments: List = immutableCopyOf("attachments", attachments)

    @field:WireField(
      tag = 6,
      adapter = "org.whispersystems.signalservice.internal.push.BodyRange#ADAPTER",
      label = WireField.Label.REPEATED,
    )
    @JvmField
    public val bodyRanges: List = immutableCopyOf("bodyRanges", bodyRanges)

    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.id = id
      builder.authorAci = authorAci
      builder.text = text
      builder.attachments = attachments
      builder.bodyRanges = bodyRanges
      builder.type = type
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is Quote) return false
      if (unknownFields != other.unknownFields) return false
      if (id != other.id) return false
      if (authorAci != other.authorAci) return false
      if (text != other.text) return false
      if (attachments != other.attachments) return false
      if (bodyRanges != other.bodyRanges) return false
      if (type != other.type) return false
      return true
    }

    public override fun hashCode(): Int {
      var result = super.hashCode
      if (result == 0) {
        result = unknownFields.hashCode()
        result = result * 37 + (id?.hashCode() ?: 0)
        result = result * 37 + (authorAci?.hashCode() ?: 0)
        result = result * 37 + (text?.hashCode() ?: 0)
        result = result * 37 + attachments.hashCode()
        result = result * 37 + bodyRanges.hashCode()
        result = result * 37 + (type?.hashCode() ?: 0)
        super.hashCode = result
      }
      return result
    }

    public override fun toString(): String {
      val result = mutableListOf()
      if (id != null) result += """id=$id"""
      if (authorAci != null) result += """authorAci=${sanitize(authorAci)}"""
      if (text != null) result += """text=${sanitize(text)}"""
      if (attachments.isNotEmpty()) result += """attachments=$attachments"""
      if (bodyRanges.isNotEmpty()) result += """bodyRanges=$bodyRanges"""
      if (type != null) result += """type=$type"""
      return result.joinToString(prefix = "Quote{", separator = ", ", postfix = "}")
    }

    public fun copy(
      id: Long? = this.id,
      authorAci: String? = this.authorAci,
      text: String? = this.text,
      attachments: List = this.attachments,
      bodyRanges: List = this.bodyRanges,
      type: Type? = this.type,
      unknownFields: ByteString = this.unknownFields,
    ): Quote = Quote(id, authorAci, text, attachments, bodyRanges, type, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var id: Long? = null

      @JvmField
      public var authorAci: String? = null

      @JvmField
      public var text: String? = null

      @JvmField
      public var attachments: List = emptyList()

      @JvmField
      public var bodyRanges: List = emptyList()

      @JvmField
      public var type: Type? = null

      public fun id(id: Long?): Builder {
        this.id = id
        return this
      }

      public fun authorAci(authorAci: String?): Builder {
        this.authorAci = authorAci
        return this
      }

      public fun text(text: String?): Builder {
        this.text = text
        return this
      }

      public fun attachments(attachments: List): Builder {
        checkElementsNotNull(attachments)
        this.attachments = attachments
        return this
      }

      public fun bodyRanges(bodyRanges: List): Builder {
        checkElementsNotNull(bodyRanges)
        this.bodyRanges = bodyRanges
        return this
      }

      public fun type(type: Type?): Builder {
        this.type = type
        return this
      }

      public override fun build(): Quote = Quote(
        id = id,
        authorAci = authorAci,
        text = text,
        attachments = attachments,
        bodyRanges = bodyRanges,
        type = type,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        Quote::class, 
        "type.googleapis.com/signalservice.DataMessage.Quote", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: Quote): Int {
          var size = value.unknownFields.size
          size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.id)
          size += ProtoAdapter.STRING.encodedSizeWithTag(5, value.authorAci)
          size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.text)
          size += QuotedAttachment.ADAPTER.asRepeated().encodedSizeWithTag(4, value.attachments)
          size += BodyRange.ADAPTER.asRepeated().encodedSizeWithTag(6, value.bodyRanges)
          size += Type.ADAPTER.encodedSizeWithTag(7, value.type)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: Quote): Unit {
          ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
          ProtoAdapter.STRING.encodeWithTag(writer, 5, value.authorAci)
          ProtoAdapter.STRING.encodeWithTag(writer, 3, value.text)
          QuotedAttachment.ADAPTER.asRepeated().encodeWithTag(writer, 4, value.attachments)
          BodyRange.ADAPTER.asRepeated().encodeWithTag(writer, 6, value.bodyRanges)
          Type.ADAPTER.encodeWithTag(writer, 7, value.type)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: Quote): Unit {
          writer.writeBytes(value.unknownFields)
          Type.ADAPTER.encodeWithTag(writer, 7, value.type)
          BodyRange.ADAPTER.asRepeated().encodeWithTag(writer, 6, value.bodyRanges)
          QuotedAttachment.ADAPTER.asRepeated().encodeWithTag(writer, 4, value.attachments)
          ProtoAdapter.STRING.encodeWithTag(writer, 3, value.text)
          ProtoAdapter.STRING.encodeWithTag(writer, 5, value.authorAci)
          ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
        }

        public override fun decode(reader: ProtoReader): Quote {
          var id: Long? = null
          var authorAci: String? = null
          var text: String? = null
          val attachments = mutableListOf()
          val bodyRanges = mutableListOf()
          var type: Type? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> id = ProtoAdapter.UINT64.decode(reader)
              5 -> authorAci = ProtoAdapter.STRING.decode(reader)
              3 -> text = ProtoAdapter.STRING.decode(reader)
              4 -> attachments.add(QuotedAttachment.ADAPTER.decode(reader))
              6 -> bodyRanges.add(BodyRange.ADAPTER.decode(reader))
              7 -> try {
                type = Type.ADAPTER.decode(reader)
              } catch (e: ProtoAdapter.EnumConstantNotFoundException) {
                reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
              }
              else -> reader.readUnknownField(tag)
            }
          }
          return Quote(
            id = id,
            authorAci = authorAci,
            text = text,
            attachments = attachments,
            bodyRanges = bodyRanges,
            type = type,
            unknownFields = unknownFields
          )
        }

        public override fun redact(`value`: Quote): Quote = value.copy(
          attachments = value.attachments.redactElements(QuotedAttachment.ADAPTER),
          bodyRanges = value.bodyRanges.redactElements(BodyRange.ADAPTER),
          unknownFields = ByteString.EMPTY
        )
      }

      private const val serialVersionUID: Long = 0L
    }

    public enum class Type(
      public override val `value`: Int,
    ) : WireEnum {
      NORMAL(0),
      GIFT_BADGE(1),
      ;

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : EnumAdapter(
          Type::class, 
          PROTO_2, 
          Type.NORMAL
        ) {
          public override fun fromValue(`value`: Int): Type? = Type.fromValue(value)
        }

        @JvmStatic
        public fun fromValue(`value`: Int): Type? = when (value) {
          0 -> NORMAL
          1 -> GIFT_BADGE
          else -> null
        }
      }
    }

    public class QuotedAttachment(
      @field:WireField(
        tag = 1,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val contentType: String? = null,
      @field:WireField(
        tag = 2,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val fileName: String? = null,
      @field:WireField(
        tag = 3,
        adapter = "org.whispersystems.signalservice.internal.push.AttachmentPointer#ADAPTER",
      )
      @JvmField
      public val thumbnail: AttachmentPointer? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.contentType = contentType
        builder.fileName = fileName
        builder.thumbnail = thumbnail
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is QuotedAttachment) return false
        if (unknownFields != other.unknownFields) return false
        if (contentType != other.contentType) return false
        if (fileName != other.fileName) return false
        if (thumbnail != other.thumbnail) return false
        return true
      }

      public override fun hashCode(): Int {
        var result = super.hashCode
        if (result == 0) {
          result = unknownFields.hashCode()
          result = result * 37 + (contentType?.hashCode() ?: 0)
          result = result * 37 + (fileName?.hashCode() ?: 0)
          result = result * 37 + (thumbnail?.hashCode() ?: 0)
          super.hashCode = result
        }
        return result
      }

      public override fun toString(): String {
        val result = mutableListOf()
        if (contentType != null) result += """contentType=${sanitize(contentType)}"""
        if (fileName != null) result += """fileName=${sanitize(fileName)}"""
        if (thumbnail != null) result += """thumbnail=$thumbnail"""
        return result.joinToString(prefix = "QuotedAttachment{", separator = ", ", postfix = "}")
      }

      public fun copy(
        contentType: String? = this.contentType,
        fileName: String? = this.fileName,
        thumbnail: AttachmentPointer? = this.thumbnail,
        unknownFields: ByteString = this.unknownFields,
      ): QuotedAttachment = QuotedAttachment(contentType, fileName, thumbnail, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var contentType: String? = null

        @JvmField
        public var fileName: String? = null

        @JvmField
        public var thumbnail: AttachmentPointer? = null

        public fun contentType(contentType: String?): Builder {
          this.contentType = contentType
          return this
        }

        public fun fileName(fileName: String?): Builder {
          this.fileName = fileName
          return this
        }

        public fun thumbnail(thumbnail: AttachmentPointer?): Builder {
          this.thumbnail = thumbnail
          return this
        }

        public override fun build(): QuotedAttachment = QuotedAttachment(
          contentType = contentType,
          fileName = fileName,
          thumbnail = thumbnail,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object :
            ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          QuotedAttachment::class, 
          "type.googleapis.com/signalservice.DataMessage.Quote.QuotedAttachment", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: QuotedAttachment): Int {
            var size = value.unknownFields.size
            size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.contentType)
            size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.fileName)
            size += AttachmentPointer.ADAPTER.encodedSizeWithTag(3, value.thumbnail)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: QuotedAttachment): Unit {
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.contentType)
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.fileName)
            AttachmentPointer.ADAPTER.encodeWithTag(writer, 3, value.thumbnail)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: QuotedAttachment): Unit {
            writer.writeBytes(value.unknownFields)
            AttachmentPointer.ADAPTER.encodeWithTag(writer, 3, value.thumbnail)
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.fileName)
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.contentType)
          }

          public override fun decode(reader: ProtoReader): QuotedAttachment {
            var contentType: String? = null
            var fileName: String? = null
            var thumbnail: AttachmentPointer? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> contentType = ProtoAdapter.STRING.decode(reader)
                2 -> fileName = ProtoAdapter.STRING.decode(reader)
                3 -> thumbnail = AttachmentPointer.ADAPTER.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return QuotedAttachment(
              contentType = contentType,
              fileName = fileName,
              thumbnail = thumbnail,
              unknownFields = unknownFields
            )
          }

          public override fun redact(`value`: QuotedAttachment): QuotedAttachment = value.copy(
            thumbnail = value.thumbnail?.let(AttachmentPointer.ADAPTER::redact),
            unknownFields = ByteString.EMPTY
          )
        }

        private const val serialVersionUID: Long = 0L
      }
    }
  }

  public class Contact(
    @field:WireField(
      tag = 1,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}Name#ADAPTER",
    )
    @JvmField
    public val name: Name? = null,
    number: List = emptyList(),
    email: List = emptyList(),
    address: List = emptyList(),
    @field:WireField(
      tag = 6,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}Avatar#ADAPTER",
    )
    @JvmField
    public val avatar: Avatar? = null,
    @field:WireField(
      tag = 7,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val organization: String? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    @field:WireField(
      tag = 3,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}Phone#ADAPTER",
      label = WireField.Label.REPEATED,
    )
    @JvmField
    public val number: List = immutableCopyOf("number", number)

    @field:WireField(
      tag = 4,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}Email#ADAPTER",
      label = WireField.Label.REPEATED,
    )
    @JvmField
    public val email: List = immutableCopyOf("email", email)

    @field:WireField(
      tag = 5,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}PostalAddress#ADAPTER",
      label = WireField.Label.REPEATED,
    )
    @JvmField
    public val address: List = immutableCopyOf("address", address)

    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.name = name
      builder.number = number
      builder.email = email
      builder.address = address
      builder.avatar = avatar
      builder.organization = organization
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is Contact) return false
      if (unknownFields != other.unknownFields) return false
      if (name != other.name) return false
      if (number != other.number) return false
      if (email != other.email) return false
      if (address != other.address) return false
      if (avatar != other.avatar) return false
      if (organization != other.organization) return false
      return true
    }

    public override fun hashCode(): Int {
      var result = super.hashCode
      if (result == 0) {
        result = unknownFields.hashCode()
        result = result * 37 + (name?.hashCode() ?: 0)
        result = result * 37 + number.hashCode()
        result = result * 37 + email.hashCode()
        result = result * 37 + address.hashCode()
        result = result * 37 + (avatar?.hashCode() ?: 0)
        result = result * 37 + (organization?.hashCode() ?: 0)
        super.hashCode = result
      }
      return result
    }

    public override fun toString(): String {
      val result = mutableListOf()
      if (name != null) result += """name=$name"""
      if (number.isNotEmpty()) result += """number=$number"""
      if (email.isNotEmpty()) result += """email=$email"""
      if (address.isNotEmpty()) result += """address=$address"""
      if (avatar != null) result += """avatar=$avatar"""
      if (organization != null) result += """organization=${sanitize(organization)}"""
      return result.joinToString(prefix = "Contact{", separator = ", ", postfix = "}")
    }

    public fun copy(
      name: Name? = this.name,
      number: List = this.number,
      email: List = this.email,
      address: List = this.address,
      avatar: Avatar? = this.avatar,
      organization: String? = this.organization,
      unknownFields: ByteString = this.unknownFields,
    ): Contact = Contact(name, number, email, address, avatar, organization, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var name: Name? = null

      @JvmField
      public var number: List = emptyList()

      @JvmField
      public var email: List = emptyList()

      @JvmField
      public var address: List = emptyList()

      @JvmField
      public var avatar: Avatar? = null

      @JvmField
      public var organization: String? = null

      public fun name(name: Name?): Builder {
        this.name = name
        return this
      }

      public fun number(number: List): Builder {
        checkElementsNotNull(number)
        this.number = number
        return this
      }

      public fun email(email: List): Builder {
        checkElementsNotNull(email)
        this.email = email
        return this
      }

      public fun address(address: List): Builder {
        checkElementsNotNull(address)
        this.address = address
        return this
      }

      public fun avatar(avatar: Avatar?): Builder {
        this.avatar = avatar
        return this
      }

      public fun organization(organization: String?): Builder {
        this.organization = organization
        return this
      }

      public override fun build(): Contact = Contact(
        name = name,
        number = number,
        email = email,
        address = address,
        avatar = avatar,
        organization = organization,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        Contact::class, 
        "type.googleapis.com/signalservice.DataMessage.Contact", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: Contact): Int {
          var size = value.unknownFields.size
          size += Name.ADAPTER.encodedSizeWithTag(1, value.name)
          size += Phone.ADAPTER.asRepeated().encodedSizeWithTag(3, value.number)
          size += Email.ADAPTER.asRepeated().encodedSizeWithTag(4, value.email)
          size += PostalAddress.ADAPTER.asRepeated().encodedSizeWithTag(5, value.address)
          size += Avatar.ADAPTER.encodedSizeWithTag(6, value.avatar)
          size += ProtoAdapter.STRING.encodedSizeWithTag(7, value.organization)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: Contact): Unit {
          Name.ADAPTER.encodeWithTag(writer, 1, value.name)
          Phone.ADAPTER.asRepeated().encodeWithTag(writer, 3, value.number)
          Email.ADAPTER.asRepeated().encodeWithTag(writer, 4, value.email)
          PostalAddress.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.address)
          Avatar.ADAPTER.encodeWithTag(writer, 6, value.avatar)
          ProtoAdapter.STRING.encodeWithTag(writer, 7, value.organization)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: Contact): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.STRING.encodeWithTag(writer, 7, value.organization)
          Avatar.ADAPTER.encodeWithTag(writer, 6, value.avatar)
          PostalAddress.ADAPTER.asRepeated().encodeWithTag(writer, 5, value.address)
          Email.ADAPTER.asRepeated().encodeWithTag(writer, 4, value.email)
          Phone.ADAPTER.asRepeated().encodeWithTag(writer, 3, value.number)
          Name.ADAPTER.encodeWithTag(writer, 1, value.name)
        }

        public override fun decode(reader: ProtoReader): Contact {
          var name: Name? = null
          val number = mutableListOf()
          val email = mutableListOf()
          val address = mutableListOf()
          var avatar: Avatar? = null
          var organization: String? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> name = Name.ADAPTER.decode(reader)
              3 -> number.add(Phone.ADAPTER.decode(reader))
              4 -> email.add(Email.ADAPTER.decode(reader))
              5 -> address.add(PostalAddress.ADAPTER.decode(reader))
              6 -> avatar = Avatar.ADAPTER.decode(reader)
              7 -> organization = ProtoAdapter.STRING.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return Contact(
            name = name,
            number = number,
            email = email,
            address = address,
            avatar = avatar,
            organization = organization,
            unknownFields = unknownFields
          )
        }

        public override fun redact(`value`: Contact): Contact = value.copy(
          name = value.name?.let(Name.ADAPTER::redact),
          number = value.number.redactElements(Phone.ADAPTER),
          email = value.email.redactElements(Email.ADAPTER),
          address = value.address.redactElements(PostalAddress.ADAPTER),
          avatar = value.avatar?.let(Avatar.ADAPTER::redact),
          unknownFields = ByteString.EMPTY
        )
      }

      private const val serialVersionUID: Long = 0L
    }

    public class Name(
      @field:WireField(
        tag = 1,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val givenName: String? = null,
      @field:WireField(
        tag = 2,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val familyName: String? = null,
      @field:WireField(
        tag = 3,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val prefix: String? = null,
      @field:WireField(
        tag = 4,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val suffix: String? = null,
      @field:WireField(
        tag = 5,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val middleName: String? = null,
      @field:WireField(
        tag = 6,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val displayName: String? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.givenName = givenName
        builder.familyName = familyName
        builder.prefix = prefix
        builder.suffix = suffix
        builder.middleName = middleName
        builder.displayName = displayName
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is Name) return false
        if (unknownFields != other.unknownFields) return false
        if (givenName != other.givenName) return false
        if (familyName != other.familyName) return false
        if (prefix != other.prefix) return false
        if (suffix != other.suffix) return false
        if (middleName != other.middleName) return false
        if (displayName != other.displayName) return false
        return true
      }

      public override fun hashCode(): Int {
        var result = super.hashCode
        if (result == 0) {
          result = unknownFields.hashCode()
          result = result * 37 + (givenName?.hashCode() ?: 0)
          result = result * 37 + (familyName?.hashCode() ?: 0)
          result = result * 37 + (prefix?.hashCode() ?: 0)
          result = result * 37 + (suffix?.hashCode() ?: 0)
          result = result * 37 + (middleName?.hashCode() ?: 0)
          result = result * 37 + (displayName?.hashCode() ?: 0)
          super.hashCode = result
        }
        return result
      }

      public override fun toString(): String {
        val result = mutableListOf()
        if (givenName != null) result += """givenName=${sanitize(givenName)}"""
        if (familyName != null) result += """familyName=${sanitize(familyName)}"""
        if (prefix != null) result += """prefix=${sanitize(prefix)}"""
        if (suffix != null) result += """suffix=${sanitize(suffix)}"""
        if (middleName != null) result += """middleName=${sanitize(middleName)}"""
        if (displayName != null) result += """displayName=${sanitize(displayName)}"""
        return result.joinToString(prefix = "Name{", separator = ", ", postfix = "}")
      }

      public fun copy(
        givenName: String? = this.givenName,
        familyName: String? = this.familyName,
        prefix: String? = this.prefix,
        suffix: String? = this.suffix,
        middleName: String? = this.middleName,
        displayName: String? = this.displayName,
        unknownFields: ByteString = this.unknownFields,
      ): Name = Name(givenName, familyName, prefix, suffix, middleName, displayName, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var givenName: String? = null

        @JvmField
        public var familyName: String? = null

        @JvmField
        public var prefix: String? = null

        @JvmField
        public var suffix: String? = null

        @JvmField
        public var middleName: String? = null

        @JvmField
        public var displayName: String? = null

        public fun givenName(givenName: String?): Builder {
          this.givenName = givenName
          return this
        }

        public fun familyName(familyName: String?): Builder {
          this.familyName = familyName
          return this
        }

        public fun prefix(prefix: String?): Builder {
          this.prefix = prefix
          return this
        }

        public fun suffix(suffix: String?): Builder {
          this.suffix = suffix
          return this
        }

        public fun middleName(middleName: String?): Builder {
          this.middleName = middleName
          return this
        }

        public fun displayName(displayName: String?): Builder {
          this.displayName = displayName
          return this
        }

        public override fun build(): Name = Name(
          givenName = givenName,
          familyName = familyName,
          prefix = prefix,
          suffix = suffix,
          middleName = middleName,
          displayName = displayName,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          Name::class, 
          "type.googleapis.com/signalservice.DataMessage.Contact.Name", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: Name): Int {
            var size = value.unknownFields.size
            size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.givenName)
            size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.familyName)
            size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.prefix)
            size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.suffix)
            size += ProtoAdapter.STRING.encodedSizeWithTag(5, value.middleName)
            size += ProtoAdapter.STRING.encodedSizeWithTag(6, value.displayName)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: Name): Unit {
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.givenName)
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.familyName)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.prefix)
            ProtoAdapter.STRING.encodeWithTag(writer, 4, value.suffix)
            ProtoAdapter.STRING.encodeWithTag(writer, 5, value.middleName)
            ProtoAdapter.STRING.encodeWithTag(writer, 6, value.displayName)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: Name): Unit {
            writer.writeBytes(value.unknownFields)
            ProtoAdapter.STRING.encodeWithTag(writer, 6, value.displayName)
            ProtoAdapter.STRING.encodeWithTag(writer, 5, value.middleName)
            ProtoAdapter.STRING.encodeWithTag(writer, 4, value.suffix)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.prefix)
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.familyName)
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.givenName)
          }

          public override fun decode(reader: ProtoReader): Name {
            var givenName: String? = null
            var familyName: String? = null
            var prefix: String? = null
            var suffix: String? = null
            var middleName: String? = null
            var displayName: String? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> givenName = ProtoAdapter.STRING.decode(reader)
                2 -> familyName = ProtoAdapter.STRING.decode(reader)
                3 -> prefix = ProtoAdapter.STRING.decode(reader)
                4 -> suffix = ProtoAdapter.STRING.decode(reader)
                5 -> middleName = ProtoAdapter.STRING.decode(reader)
                6 -> displayName = ProtoAdapter.STRING.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return Name(
              givenName = givenName,
              familyName = familyName,
              prefix = prefix,
              suffix = suffix,
              middleName = middleName,
              displayName = displayName,
              unknownFields = unknownFields
            )
          }

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

        private const val serialVersionUID: Long = 0L
      }
    }

    public class Phone(
      @field:WireField(
        tag = 1,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
        declaredName = "value",
      )
      @JvmField
      public val value_: String? = null,
      @field:WireField(
        tag = 2,
        adapter =
            "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}Phone${'$'}Type#ADAPTER",
      )
      @JvmField
      public val type: Type? = null,
      @field:WireField(
        tag = 3,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val label: String? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.value_ = value_
        builder.type = type
        builder.label = label
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is Phone) return false
        if (unknownFields != other.unknownFields) return false
        if (value_ != other.value_) return false
        if (type != other.type) return false
        if (label != other.label) return false
        return true
      }

      public override fun hashCode(): Int {
        var result = super.hashCode
        if (result == 0) {
          result = unknownFields.hashCode()
          result = result * 37 + (value_?.hashCode() ?: 0)
          result = result * 37 + (type?.hashCode() ?: 0)
          result = result * 37 + (label?.hashCode() ?: 0)
          super.hashCode = result
        }
        return result
      }

      public override fun toString(): String {
        val result = mutableListOf()
        if (value_ != null) result += """value_=${sanitize(value_)}"""
        if (type != null) result += """type=$type"""
        if (label != null) result += """label=${sanitize(label)}"""
        return result.joinToString(prefix = "Phone{", separator = ", ", postfix = "}")
      }

      public fun copy(
        value_: String? = this.value_,
        type: Type? = this.type,
        label: String? = this.label,
        unknownFields: ByteString = this.unknownFields,
      ): Phone = Phone(value_, type, label, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var value_: String? = null

        @JvmField
        public var type: Type? = null

        @JvmField
        public var label: String? = null

        public fun value_(value_: String?): Builder {
          this.value_ = value_
          return this
        }

        public fun type(type: Type?): Builder {
          this.type = type
          return this
        }

        public fun label(label: String?): Builder {
          this.label = label
          return this
        }

        public override fun build(): Phone = Phone(
          value_ = value_,
          type = type,
          label = label,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          Phone::class, 
          "type.googleapis.com/signalservice.DataMessage.Contact.Phone", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: Phone): Int {
            var size = value.unknownFields.size
            size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.value_)
            size += Type.ADAPTER.encodedSizeWithTag(2, value.type)
            size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.label)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: Phone): Unit {
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.value_)
            Type.ADAPTER.encodeWithTag(writer, 2, value.type)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.label)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: Phone): Unit {
            writer.writeBytes(value.unknownFields)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.label)
            Type.ADAPTER.encodeWithTag(writer, 2, value.type)
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.value_)
          }

          public override fun decode(reader: ProtoReader): Phone {
            var value_: String? = null
            var type: Type? = null
            var label: String? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> value_ = ProtoAdapter.STRING.decode(reader)
                2 -> try {
                  type = Type.ADAPTER.decode(reader)
                } catch (e: ProtoAdapter.EnumConstantNotFoundException) {
                  reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
                }
                3 -> label = ProtoAdapter.STRING.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return Phone(
              value_ = value_,
              type = type,
              label = label,
              unknownFields = unknownFields
            )
          }

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

        private const val serialVersionUID: Long = 0L
      }

      public enum class Type(
        public override val `value`: Int,
      ) : WireEnum {
        HOME(1),
        MOBILE(2),
        WORK(3),
        CUSTOM(4),
        ;

        public companion object {
          @JvmField
          public val ADAPTER: ProtoAdapter = object : EnumAdapter(
            Type::class, 
            PROTO_2, 
            null
          ) {
            public override fun fromValue(`value`: Int): Type? = Type.fromValue(value)
          }

          @JvmStatic
          public fun fromValue(`value`: Int): Type? = when (value) {
            1 -> HOME
            2 -> MOBILE
            3 -> WORK
            4 -> CUSTOM
            else -> null
          }
        }
      }
    }

    public class Email(
      @field:WireField(
        tag = 1,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
        declaredName = "value",
      )
      @JvmField
      public val value_: String? = null,
      @field:WireField(
        tag = 2,
        adapter =
            "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}Email${'$'}Type#ADAPTER",
      )
      @JvmField
      public val type: Type? = null,
      @field:WireField(
        tag = 3,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val label: String? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.value_ = value_
        builder.type = type
        builder.label = label
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is Email) return false
        if (unknownFields != other.unknownFields) return false
        if (value_ != other.value_) return false
        if (type != other.type) return false
        if (label != other.label) return false
        return true
      }

      public override fun hashCode(): Int {
        var result = super.hashCode
        if (result == 0) {
          result = unknownFields.hashCode()
          result = result * 37 + (value_?.hashCode() ?: 0)
          result = result * 37 + (type?.hashCode() ?: 0)
          result = result * 37 + (label?.hashCode() ?: 0)
          super.hashCode = result
        }
        return result
      }

      public override fun toString(): String {
        val result = mutableListOf()
        if (value_ != null) result += """value_=${sanitize(value_)}"""
        if (type != null) result += """type=$type"""
        if (label != null) result += """label=${sanitize(label)}"""
        return result.joinToString(prefix = "Email{", separator = ", ", postfix = "}")
      }

      public fun copy(
        value_: String? = this.value_,
        type: Type? = this.type,
        label: String? = this.label,
        unknownFields: ByteString = this.unknownFields,
      ): Email = Email(value_, type, label, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var value_: String? = null

        @JvmField
        public var type: Type? = null

        @JvmField
        public var label: String? = null

        public fun value_(value_: String?): Builder {
          this.value_ = value_
          return this
        }

        public fun type(type: Type?): Builder {
          this.type = type
          return this
        }

        public fun label(label: String?): Builder {
          this.label = label
          return this
        }

        public override fun build(): Email = Email(
          value_ = value_,
          type = type,
          label = label,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          Email::class, 
          "type.googleapis.com/signalservice.DataMessage.Contact.Email", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: Email): Int {
            var size = value.unknownFields.size
            size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.value_)
            size += Type.ADAPTER.encodedSizeWithTag(2, value.type)
            size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.label)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: Email): Unit {
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.value_)
            Type.ADAPTER.encodeWithTag(writer, 2, value.type)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.label)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: Email): Unit {
            writer.writeBytes(value.unknownFields)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.label)
            Type.ADAPTER.encodeWithTag(writer, 2, value.type)
            ProtoAdapter.STRING.encodeWithTag(writer, 1, value.value_)
          }

          public override fun decode(reader: ProtoReader): Email {
            var value_: String? = null
            var type: Type? = null
            var label: String? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> value_ = ProtoAdapter.STRING.decode(reader)
                2 -> try {
                  type = Type.ADAPTER.decode(reader)
                } catch (e: ProtoAdapter.EnumConstantNotFoundException) {
                  reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
                }
                3 -> label = ProtoAdapter.STRING.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return Email(
              value_ = value_,
              type = type,
              label = label,
              unknownFields = unknownFields
            )
          }

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

        private const val serialVersionUID: Long = 0L
      }

      public enum class Type(
        public override val `value`: Int,
      ) : WireEnum {
        HOME(1),
        MOBILE(2),
        WORK(3),
        CUSTOM(4),
        ;

        public companion object {
          @JvmField
          public val ADAPTER: ProtoAdapter = object : EnumAdapter(
            Type::class, 
            PROTO_2, 
            null
          ) {
            public override fun fromValue(`value`: Int): Type? = Type.fromValue(value)
          }

          @JvmStatic
          public fun fromValue(`value`: Int): Type? = when (value) {
            1 -> HOME
            2 -> MOBILE
            3 -> WORK
            4 -> CUSTOM
            else -> null
          }
        }
      }
    }

    public class PostalAddress(
      @field:WireField(
        tag = 1,
        adapter =
            "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Contact${'$'}PostalAddress${'$'}Type#ADAPTER",
      )
      @JvmField
      public val type: Type? = null,
      @field:WireField(
        tag = 2,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val label: String? = null,
      @field:WireField(
        tag = 3,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val street: String? = null,
      @field:WireField(
        tag = 4,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val pobox: String? = null,
      @field:WireField(
        tag = 5,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val neighborhood: String? = null,
      @field:WireField(
        tag = 6,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val city: String? = null,
      @field:WireField(
        tag = 7,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val region: String? = null,
      @field:WireField(
        tag = 8,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val postcode: String? = null,
      @field:WireField(
        tag = 9,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val country: String? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.type = type
        builder.label = label
        builder.street = street
        builder.pobox = pobox
        builder.neighborhood = neighborhood
        builder.city = city
        builder.region = region
        builder.postcode = postcode
        builder.country = country
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is PostalAddress) return false
        if (unknownFields != other.unknownFields) return false
        if (type != other.type) return false
        if (label != other.label) return false
        if (street != other.street) return false
        if (pobox != other.pobox) return false
        if (neighborhood != other.neighborhood) return false
        if (city != other.city) return false
        if (region != other.region) return false
        if (postcode != other.postcode) return false
        if (country != other.country) return false
        return true
      }

      public override fun hashCode(): Int {
        var result = super.hashCode
        if (result == 0) {
          result = unknownFields.hashCode()
          result = result * 37 + (type?.hashCode() ?: 0)
          result = result * 37 + (label?.hashCode() ?: 0)
          result = result * 37 + (street?.hashCode() ?: 0)
          result = result * 37 + (pobox?.hashCode() ?: 0)
          result = result * 37 + (neighborhood?.hashCode() ?: 0)
          result = result * 37 + (city?.hashCode() ?: 0)
          result = result * 37 + (region?.hashCode() ?: 0)
          result = result * 37 + (postcode?.hashCode() ?: 0)
          result = result * 37 + (country?.hashCode() ?: 0)
          super.hashCode = result
        }
        return result
      }

      public override fun toString(): String {
        val result = mutableListOf()
        if (type != null) result += """type=$type"""
        if (label != null) result += """label=${sanitize(label)}"""
        if (street != null) result += """street=${sanitize(street)}"""
        if (pobox != null) result += """pobox=${sanitize(pobox)}"""
        if (neighborhood != null) result += """neighborhood=${sanitize(neighborhood)}"""
        if (city != null) result += """city=${sanitize(city)}"""
        if (region != null) result += """region=${sanitize(region)}"""
        if (postcode != null) result += """postcode=${sanitize(postcode)}"""
        if (country != null) result += """country=${sanitize(country)}"""
        return result.joinToString(prefix = "PostalAddress{", separator = ", ", postfix = "}")
      }

      public fun copy(
        type: Type? = this.type,
        label: String? = this.label,
        street: String? = this.street,
        pobox: String? = this.pobox,
        neighborhood: String? = this.neighborhood,
        city: String? = this.city,
        region: String? = this.region,
        postcode: String? = this.postcode,
        country: String? = this.country,
        unknownFields: ByteString = this.unknownFields,
      ): PostalAddress = PostalAddress(type, label, street, pobox, neighborhood, city, region,
          postcode, country, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var type: Type? = null

        @JvmField
        public var label: String? = null

        @JvmField
        public var street: String? = null

        @JvmField
        public var pobox: String? = null

        @JvmField
        public var neighborhood: String? = null

        @JvmField
        public var city: String? = null

        @JvmField
        public var region: String? = null

        @JvmField
        public var postcode: String? = null

        @JvmField
        public var country: String? = null

        public fun type(type: Type?): Builder {
          this.type = type
          return this
        }

        public fun label(label: String?): Builder {
          this.label = label
          return this
        }

        public fun street(street: String?): Builder {
          this.street = street
          return this
        }

        public fun pobox(pobox: String?): Builder {
          this.pobox = pobox
          return this
        }

        public fun neighborhood(neighborhood: String?): Builder {
          this.neighborhood = neighborhood
          return this
        }

        public fun city(city: String?): Builder {
          this.city = city
          return this
        }

        public fun region(region: String?): Builder {
          this.region = region
          return this
        }

        public fun postcode(postcode: String?): Builder {
          this.postcode = postcode
          return this
        }

        public fun country(country: String?): Builder {
          this.country = country
          return this
        }

        public override fun build(): PostalAddress = PostalAddress(
          type = type,
          label = label,
          street = street,
          pobox = pobox,
          neighborhood = neighborhood,
          city = city,
          region = region,
          postcode = postcode,
          country = country,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          PostalAddress::class, 
          "type.googleapis.com/signalservice.DataMessage.Contact.PostalAddress", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: PostalAddress): Int {
            var size = value.unknownFields.size
            size += Type.ADAPTER.encodedSizeWithTag(1, value.type)
            size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.label)
            size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.street)
            size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.pobox)
            size += ProtoAdapter.STRING.encodedSizeWithTag(5, value.neighborhood)
            size += ProtoAdapter.STRING.encodedSizeWithTag(6, value.city)
            size += ProtoAdapter.STRING.encodedSizeWithTag(7, value.region)
            size += ProtoAdapter.STRING.encodedSizeWithTag(8, value.postcode)
            size += ProtoAdapter.STRING.encodedSizeWithTag(9, value.country)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: PostalAddress): Unit {
            Type.ADAPTER.encodeWithTag(writer, 1, value.type)
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.label)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.street)
            ProtoAdapter.STRING.encodeWithTag(writer, 4, value.pobox)
            ProtoAdapter.STRING.encodeWithTag(writer, 5, value.neighborhood)
            ProtoAdapter.STRING.encodeWithTag(writer, 6, value.city)
            ProtoAdapter.STRING.encodeWithTag(writer, 7, value.region)
            ProtoAdapter.STRING.encodeWithTag(writer, 8, value.postcode)
            ProtoAdapter.STRING.encodeWithTag(writer, 9, value.country)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: PostalAddress): Unit {
            writer.writeBytes(value.unknownFields)
            ProtoAdapter.STRING.encodeWithTag(writer, 9, value.country)
            ProtoAdapter.STRING.encodeWithTag(writer, 8, value.postcode)
            ProtoAdapter.STRING.encodeWithTag(writer, 7, value.region)
            ProtoAdapter.STRING.encodeWithTag(writer, 6, value.city)
            ProtoAdapter.STRING.encodeWithTag(writer, 5, value.neighborhood)
            ProtoAdapter.STRING.encodeWithTag(writer, 4, value.pobox)
            ProtoAdapter.STRING.encodeWithTag(writer, 3, value.street)
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.label)
            Type.ADAPTER.encodeWithTag(writer, 1, value.type)
          }

          public override fun decode(reader: ProtoReader): PostalAddress {
            var type: Type? = null
            var label: String? = null
            var street: String? = null
            var pobox: String? = null
            var neighborhood: String? = null
            var city: String? = null
            var region: String? = null
            var postcode: String? = null
            var country: String? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> try {
                  type = Type.ADAPTER.decode(reader)
                } catch (e: ProtoAdapter.EnumConstantNotFoundException) {
                  reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
                }
                2 -> label = ProtoAdapter.STRING.decode(reader)
                3 -> street = ProtoAdapter.STRING.decode(reader)
                4 -> pobox = ProtoAdapter.STRING.decode(reader)
                5 -> neighborhood = ProtoAdapter.STRING.decode(reader)
                6 -> city = ProtoAdapter.STRING.decode(reader)
                7 -> region = ProtoAdapter.STRING.decode(reader)
                8 -> postcode = ProtoAdapter.STRING.decode(reader)
                9 -> country = ProtoAdapter.STRING.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return PostalAddress(
              type = type,
              label = label,
              street = street,
              pobox = pobox,
              neighborhood = neighborhood,
              city = city,
              region = region,
              postcode = postcode,
              country = country,
              unknownFields = unknownFields
            )
          }

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

        private const val serialVersionUID: Long = 0L
      }

      public enum class Type(
        public override val `value`: Int,
      ) : WireEnum {
        HOME(1),
        WORK(2),
        CUSTOM(3),
        ;

        public companion object {
          @JvmField
          public val ADAPTER: ProtoAdapter = object : EnumAdapter(
            Type::class, 
            PROTO_2, 
            null
          ) {
            public override fun fromValue(`value`: Int): Type? = Type.fromValue(value)
          }

          @JvmStatic
          public fun fromValue(`value`: Int): Type? = when (value) {
            1 -> HOME
            2 -> WORK
            3 -> CUSTOM
            else -> null
          }
        }
      }
    }

    public class Avatar(
      @field:WireField(
        tag = 1,
        adapter = "org.whispersystems.signalservice.internal.push.AttachmentPointer#ADAPTER",
      )
      @JvmField
      public val avatar: AttachmentPointer? = null,
      @field:WireField(
        tag = 2,
        adapter = "com.squareup.wire.ProtoAdapter#BOOL",
      )
      @JvmField
      public val isProfile: Boolean? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.avatar = avatar
        builder.isProfile = isProfile
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is Avatar) return false
        if (unknownFields != other.unknownFields) return false
        if (avatar != other.avatar) return false
        if (isProfile != other.isProfile) return false
        return true
      }

      public override fun hashCode(): Int {
        var result = super.hashCode
        if (result == 0) {
          result = unknownFields.hashCode()
          result = result * 37 + (avatar?.hashCode() ?: 0)
          result = result * 37 + (isProfile?.hashCode() ?: 0)
          super.hashCode = result
        }
        return result
      }

      public override fun toString(): String {
        val result = mutableListOf()
        if (avatar != null) result += """avatar=$avatar"""
        if (isProfile != null) result += """isProfile=$isProfile"""
        return result.joinToString(prefix = "Avatar{", separator = ", ", postfix = "}")
      }

      public fun copy(
        avatar: AttachmentPointer? = this.avatar,
        isProfile: Boolean? = this.isProfile,
        unknownFields: ByteString = this.unknownFields,
      ): Avatar = Avatar(avatar, isProfile, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var avatar: AttachmentPointer? = null

        @JvmField
        public var isProfile: Boolean? = null

        public fun avatar(avatar: AttachmentPointer?): Builder {
          this.avatar = avatar
          return this
        }

        public fun isProfile(isProfile: Boolean?): Builder {
          this.isProfile = isProfile
          return this
        }

        public override fun build(): Avatar = Avatar(
          avatar = avatar,
          isProfile = isProfile,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          Avatar::class, 
          "type.googleapis.com/signalservice.DataMessage.Contact.Avatar", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: Avatar): Int {
            var size = value.unknownFields.size
            size += AttachmentPointer.ADAPTER.encodedSizeWithTag(1, value.avatar)
            size += ProtoAdapter.BOOL.encodedSizeWithTag(2, value.isProfile)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: Avatar): Unit {
            AttachmentPointer.ADAPTER.encodeWithTag(writer, 1, value.avatar)
            ProtoAdapter.BOOL.encodeWithTag(writer, 2, value.isProfile)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: Avatar): Unit {
            writer.writeBytes(value.unknownFields)
            ProtoAdapter.BOOL.encodeWithTag(writer, 2, value.isProfile)
            AttachmentPointer.ADAPTER.encodeWithTag(writer, 1, value.avatar)
          }

          public override fun decode(reader: ProtoReader): Avatar {
            var avatar: AttachmentPointer? = null
            var isProfile: Boolean? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> avatar = AttachmentPointer.ADAPTER.decode(reader)
                2 -> isProfile = ProtoAdapter.BOOL.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return Avatar(
              avatar = avatar,
              isProfile = isProfile,
              unknownFields = unknownFields
            )
          }

          public override fun redact(`value`: Avatar): Avatar = value.copy(
            avatar = value.avatar?.let(AttachmentPointer.ADAPTER::redact),
            unknownFields = ByteString.EMPTY
          )
        }

        private const val serialVersionUID: Long = 0L
      }
    }
  }

  public class Sticker(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    )
    @JvmField
    public val packId: ByteString? = null,
    @field:WireField(
      tag = 2,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    )
    @JvmField
    public val packKey: ByteString? = null,
    @field:WireField(
      tag = 3,
      adapter = "com.squareup.wire.ProtoAdapter#UINT32",
    )
    @JvmField
    public val stickerId: Int? = null,
    @field:WireField(
      tag = 4,
      adapter = "org.whispersystems.signalservice.internal.push.AttachmentPointer#ADAPTER",
      declaredName = "data",
    )
    @JvmField
    public val data_: AttachmentPointer? = null,
    @field:WireField(
      tag = 5,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val emoji: String? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.packId = packId
      builder.packKey = packKey
      builder.stickerId = stickerId
      builder.data_ = data_
      builder.emoji = emoji
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is Sticker) return false
      if (unknownFields != other.unknownFields) return false
      if (packId != other.packId) return false
      if (packKey != other.packKey) return false
      if (stickerId != other.stickerId) return false
      if (data_ != other.data_) return false
      if (emoji != other.emoji) return false
      return true
    }

    public override fun hashCode(): Int {
      var result = super.hashCode
      if (result == 0) {
        result = unknownFields.hashCode()
        result = result * 37 + (packId?.hashCode() ?: 0)
        result = result * 37 + (packKey?.hashCode() ?: 0)
        result = result * 37 + (stickerId?.hashCode() ?: 0)
        result = result * 37 + (data_?.hashCode() ?: 0)
        result = result * 37 + (emoji?.hashCode() ?: 0)
        super.hashCode = result
      }
      return result
    }

    public override fun toString(): String {
      val result = mutableListOf()
      if (packId != null) result += """packId=$packId"""
      if (packKey != null) result += """packKey=$packKey"""
      if (stickerId != null) result += """stickerId=$stickerId"""
      if (data_ != null) result += """data_=$data_"""
      if (emoji != null) result += """emoji=${sanitize(emoji)}"""
      return result.joinToString(prefix = "Sticker{", separator = ", ", postfix = "}")
    }

    public fun copy(
      packId: ByteString? = this.packId,
      packKey: ByteString? = this.packKey,
      stickerId: Int? = this.stickerId,
      data_: AttachmentPointer? = this.data_,
      emoji: String? = this.emoji,
      unknownFields: ByteString = this.unknownFields,
    ): Sticker = Sticker(packId, packKey, stickerId, data_, emoji, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var packId: ByteString? = null

      @JvmField
      public var packKey: ByteString? = null

      @JvmField
      public var stickerId: Int? = null

      @JvmField
      public var data_: AttachmentPointer? = null

      @JvmField
      public var emoji: String? = null

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

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

      public fun stickerId(stickerId: Int?): Builder {
        this.stickerId = stickerId
        return this
      }

      public fun data_(data_: AttachmentPointer?): Builder {
        this.data_ = data_
        return this
      }

      public fun emoji(emoji: String?): Builder {
        this.emoji = emoji
        return this
      }

      public override fun build(): Sticker = Sticker(
        packId = packId,
        packKey = packKey,
        stickerId = stickerId,
        data_ = data_,
        emoji = emoji,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        Sticker::class, 
        "type.googleapis.com/signalservice.DataMessage.Sticker", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: Sticker): Int {
          var size = value.unknownFields.size
          size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.packId)
          size += ProtoAdapter.BYTES.encodedSizeWithTag(2, value.packKey)
          size += ProtoAdapter.UINT32.encodedSizeWithTag(3, value.stickerId)
          size += AttachmentPointer.ADAPTER.encodedSizeWithTag(4, value.data_)
          size += ProtoAdapter.STRING.encodedSizeWithTag(5, value.emoji)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: Sticker): Unit {
          ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.packId)
          ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.packKey)
          ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.stickerId)
          AttachmentPointer.ADAPTER.encodeWithTag(writer, 4, value.data_)
          ProtoAdapter.STRING.encodeWithTag(writer, 5, value.emoji)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: Sticker): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.STRING.encodeWithTag(writer, 5, value.emoji)
          AttachmentPointer.ADAPTER.encodeWithTag(writer, 4, value.data_)
          ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.stickerId)
          ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.packKey)
          ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.packId)
        }

        public override fun decode(reader: ProtoReader): Sticker {
          var packId: ByteString? = null
          var packKey: ByteString? = null
          var stickerId: Int? = null
          var data_: AttachmentPointer? = null
          var emoji: String? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> packId = ProtoAdapter.BYTES.decode(reader)
              2 -> packKey = ProtoAdapter.BYTES.decode(reader)
              3 -> stickerId = ProtoAdapter.UINT32.decode(reader)
              4 -> data_ = AttachmentPointer.ADAPTER.decode(reader)
              5 -> emoji = ProtoAdapter.STRING.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return Sticker(
            packId = packId,
            packKey = packKey,
            stickerId = stickerId,
            data_ = data_,
            emoji = emoji,
            unknownFields = unknownFields
          )
        }

        public override fun redact(`value`: Sticker): Sticker = value.copy(
          data_ = value.data_?.let(AttachmentPointer.ADAPTER::redact),
          unknownFields = ByteString.EMPTY
        )
      }

      private const val serialVersionUID: Long = 0L
    }
  }

  public class Reaction(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val emoji: String? = null,
    @field:WireField(
      tag = 2,
      adapter = "com.squareup.wire.ProtoAdapter#BOOL",
    )
    @JvmField
    public val remove: Boolean? = null,
    @field:WireField(
      tag = 4,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val targetAuthorAci: String? = null,
    @field:WireField(
      tag = 5,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
    )
    @JvmField
    public val targetSentTimestamp: Long? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.emoji = emoji
      builder.remove = remove
      builder.targetAuthorAci = targetAuthorAci
      builder.targetSentTimestamp = targetSentTimestamp
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is Reaction) return false
      if (unknownFields != other.unknownFields) return false
      if (emoji != other.emoji) return false
      if (remove != other.remove) return false
      if (targetAuthorAci != other.targetAuthorAci) return false
      if (targetSentTimestamp != other.targetSentTimestamp) return false
      return true
    }

    public override fun hashCode(): Int {
      var result = super.hashCode
      if (result == 0) {
        result = unknownFields.hashCode()
        result = result * 37 + (emoji?.hashCode() ?: 0)
        result = result * 37 + (remove?.hashCode() ?: 0)
        result = result * 37 + (targetAuthorAci?.hashCode() ?: 0)
        result = result * 37 + (targetSentTimestamp?.hashCode() ?: 0)
        super.hashCode = result
      }
      return result
    }

    public override fun toString(): String {
      val result = mutableListOf()
      if (emoji != null) result += """emoji=${sanitize(emoji)}"""
      if (remove != null) result += """remove=$remove"""
      if (targetAuthorAci != null) result += """targetAuthorAci=${sanitize(targetAuthorAci)}"""
      if (targetSentTimestamp != null) result += """targetSentTimestamp=$targetSentTimestamp"""
      return result.joinToString(prefix = "Reaction{", separator = ", ", postfix = "}")
    }

    public fun copy(
      emoji: String? = this.emoji,
      remove: Boolean? = this.remove,
      targetAuthorAci: String? = this.targetAuthorAci,
      targetSentTimestamp: Long? = this.targetSentTimestamp,
      unknownFields: ByteString = this.unknownFields,
    ): Reaction = Reaction(emoji, remove, targetAuthorAci, targetSentTimestamp, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var emoji: String? = null

      @JvmField
      public var remove: Boolean? = null

      @JvmField
      public var targetAuthorAci: String? = null

      @JvmField
      public var targetSentTimestamp: Long? = null

      public fun emoji(emoji: String?): Builder {
        this.emoji = emoji
        return this
      }

      public fun remove(remove: Boolean?): Builder {
        this.remove = remove
        return this
      }

      public fun targetAuthorAci(targetAuthorAci: String?): Builder {
        this.targetAuthorAci = targetAuthorAci
        return this
      }

      public fun targetSentTimestamp(targetSentTimestamp: Long?): Builder {
        this.targetSentTimestamp = targetSentTimestamp
        return this
      }

      public override fun build(): Reaction = Reaction(
        emoji = emoji,
        remove = remove,
        targetAuthorAci = targetAuthorAci,
        targetSentTimestamp = targetSentTimestamp,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        Reaction::class, 
        "type.googleapis.com/signalservice.DataMessage.Reaction", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: Reaction): Int {
          var size = value.unknownFields.size
          size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.emoji)
          size += ProtoAdapter.BOOL.encodedSizeWithTag(2, value.remove)
          size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.targetAuthorAci)
          size += ProtoAdapter.UINT64.encodedSizeWithTag(5, value.targetSentTimestamp)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: Reaction): Unit {
          ProtoAdapter.STRING.encodeWithTag(writer, 1, value.emoji)
          ProtoAdapter.BOOL.encodeWithTag(writer, 2, value.remove)
          ProtoAdapter.STRING.encodeWithTag(writer, 4, value.targetAuthorAci)
          ProtoAdapter.UINT64.encodeWithTag(writer, 5, value.targetSentTimestamp)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: Reaction): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.UINT64.encodeWithTag(writer, 5, value.targetSentTimestamp)
          ProtoAdapter.STRING.encodeWithTag(writer, 4, value.targetAuthorAci)
          ProtoAdapter.BOOL.encodeWithTag(writer, 2, value.remove)
          ProtoAdapter.STRING.encodeWithTag(writer, 1, value.emoji)
        }

        public override fun decode(reader: ProtoReader): Reaction {
          var emoji: String? = null
          var remove: Boolean? = null
          var targetAuthorAci: String? = null
          var targetSentTimestamp: Long? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> emoji = ProtoAdapter.STRING.decode(reader)
              2 -> remove = ProtoAdapter.BOOL.decode(reader)
              4 -> targetAuthorAci = ProtoAdapter.STRING.decode(reader)
              5 -> targetSentTimestamp = ProtoAdapter.UINT64.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return Reaction(
            emoji = emoji,
            remove = remove,
            targetAuthorAci = targetAuthorAci,
            targetSentTimestamp = targetSentTimestamp,
            unknownFields = unknownFields
          )
        }

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

      private const val serialVersionUID: Long = 0L
    }
  }

  public class Delete(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
    )
    @JvmField
    public val targetSentTimestamp: Long? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.targetSentTimestamp = targetSentTimestamp
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is Delete) return false
      if (unknownFields != other.unknownFields) return false
      if (targetSentTimestamp != other.targetSentTimestamp) return false
      return true
    }

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

    public override fun toString(): String {
      val result = mutableListOf()
      if (targetSentTimestamp != null) result += """targetSentTimestamp=$targetSentTimestamp"""
      return result.joinToString(prefix = "Delete{", separator = ", ", postfix = "}")
    }

    public fun copy(targetSentTimestamp: Long? = this.targetSentTimestamp, unknownFields: ByteString
        = this.unknownFields): Delete = Delete(targetSentTimestamp, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var targetSentTimestamp: Long? = null

      public fun targetSentTimestamp(targetSentTimestamp: Long?): Builder {
        this.targetSentTimestamp = targetSentTimestamp
        return this
      }

      public override fun build(): Delete = Delete(
        targetSentTimestamp = targetSentTimestamp,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        Delete::class, 
        "type.googleapis.com/signalservice.DataMessage.Delete", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: Delete): Int {
          var size = value.unknownFields.size
          size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.targetSentTimestamp)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: Delete): Unit {
          ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.targetSentTimestamp)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: Delete): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.targetSentTimestamp)
        }

        public override fun decode(reader: ProtoReader): Delete {
          var targetSentTimestamp: Long? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> targetSentTimestamp = ProtoAdapter.UINT64.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return Delete(
            targetSentTimestamp = targetSentTimestamp,
            unknownFields = unknownFields
          )
        }

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

      private const val serialVersionUID: Long = 0L
    }
  }

  public class GroupCallUpdate(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val eraId: String? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.eraId = eraId
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is GroupCallUpdate) return false
      if (unknownFields != other.unknownFields) return false
      if (eraId != other.eraId) return false
      return true
    }

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

    public override fun toString(): String {
      val result = mutableListOf()
      if (eraId != null) result += """eraId=${sanitize(eraId)}"""
      return result.joinToString(prefix = "GroupCallUpdate{", separator = ", ", postfix = "}")
    }

    public fun copy(eraId: String? = this.eraId, unknownFields: ByteString = this.unknownFields):
        GroupCallUpdate = GroupCallUpdate(eraId, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var eraId: String? = null

      public fun eraId(eraId: String?): Builder {
        this.eraId = eraId
        return this
      }

      public override fun build(): GroupCallUpdate = GroupCallUpdate(
        eraId = eraId,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        GroupCallUpdate::class, 
        "type.googleapis.com/signalservice.DataMessage.GroupCallUpdate", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: GroupCallUpdate): Int {
          var size = value.unknownFields.size
          size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.eraId)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: GroupCallUpdate): Unit {
          ProtoAdapter.STRING.encodeWithTag(writer, 1, value.eraId)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: GroupCallUpdate): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.STRING.encodeWithTag(writer, 1, value.eraId)
        }

        public override fun decode(reader: ProtoReader): GroupCallUpdate {
          var eraId: String? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> eraId = ProtoAdapter.STRING.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return GroupCallUpdate(
            eraId = eraId,
            unknownFields = unknownFields
          )
        }

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

      private const val serialVersionUID: Long = 0L
    }
  }

  public class StoryContext(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
    )
    @JvmField
    public val authorAci: String? = null,
    @field:WireField(
      tag = 2,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
    )
    @JvmField
    public val sentTimestamp: Long? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.authorAci = authorAci
      builder.sentTimestamp = sentTimestamp
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is StoryContext) return false
      if (unknownFields != other.unknownFields) return false
      if (authorAci != other.authorAci) return false
      if (sentTimestamp != other.sentTimestamp) return false
      return true
    }

    public override fun hashCode(): Int {
      var result = super.hashCode
      if (result == 0) {
        result = unknownFields.hashCode()
        result = result * 37 + (authorAci?.hashCode() ?: 0)
        result = result * 37 + (sentTimestamp?.hashCode() ?: 0)
        super.hashCode = result
      }
      return result
    }

    public override fun toString(): String {
      val result = mutableListOf()
      if (authorAci != null) result += """authorAci=${sanitize(authorAci)}"""
      if (sentTimestamp != null) result += """sentTimestamp=$sentTimestamp"""
      return result.joinToString(prefix = "StoryContext{", separator = ", ", postfix = "}")
    }

    public fun copy(
      authorAci: String? = this.authorAci,
      sentTimestamp: Long? = this.sentTimestamp,
      unknownFields: ByteString = this.unknownFields,
    ): StoryContext = StoryContext(authorAci, sentTimestamp, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var authorAci: String? = null

      @JvmField
      public var sentTimestamp: Long? = null

      public fun authorAci(authorAci: String?): Builder {
        this.authorAci = authorAci
        return this
      }

      public fun sentTimestamp(sentTimestamp: Long?): Builder {
        this.sentTimestamp = sentTimestamp
        return this
      }

      public override fun build(): StoryContext = StoryContext(
        authorAci = authorAci,
        sentTimestamp = sentTimestamp,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        StoryContext::class, 
        "type.googleapis.com/signalservice.DataMessage.StoryContext", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: StoryContext): Int {
          var size = value.unknownFields.size
          size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.authorAci)
          size += ProtoAdapter.UINT64.encodedSizeWithTag(2, value.sentTimestamp)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: StoryContext): Unit {
          ProtoAdapter.STRING.encodeWithTag(writer, 1, value.authorAci)
          ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.sentTimestamp)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: StoryContext): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.UINT64.encodeWithTag(writer, 2, value.sentTimestamp)
          ProtoAdapter.STRING.encodeWithTag(writer, 1, value.authorAci)
        }

        public override fun decode(reader: ProtoReader): StoryContext {
          var authorAci: String? = null
          var sentTimestamp: Long? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> authorAci = ProtoAdapter.STRING.decode(reader)
              2 -> sentTimestamp = ProtoAdapter.UINT64.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return StoryContext(
            authorAci = authorAci,
            sentTimestamp = sentTimestamp,
            unknownFields = unknownFields
          )
        }

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

      private const val serialVersionUID: Long = 0L
    }
  }

  public class Payment(
    @field:WireField(
      tag = 1,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Payment${'$'}Notification#ADAPTER",
      oneofName = "Item",
    )
    @JvmField
    public val notification: Notification? = null,
    @field:WireField(
      tag = 2,
      adapter =
          "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Payment${'$'}Activation#ADAPTER",
      oneofName = "Item",
    )
    @JvmField
    public val activation: Activation? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    init {
      require(countNonDefa(notification, activation) <= 1) {
        "At most one of notification, activation may be non-null"
      }
    }

    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.notification = notification
      builder.activation = activation
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is Payment) return false
      if (unknownFields != other.unknownFields) return false
      if (notification != other.notification) return false
      if (activation != other.activation) return false
      return true
    }

    public override fun hashCode(): Int {
      var result = super.hashCode
      if (result == 0) {
        result = unknownFields.hashCode()
        result = result * 37 + (notification?.hashCode() ?: 0)
        result = result * 37 + (activation?.hashCode() ?: 0)
        super.hashCode = result
      }
      return result
    }

    public override fun toString(): String {
      val result = mutableListOf()
      if (notification != null) result += """notification=$notification"""
      if (activation != null) result += """activation=$activation"""
      return result.joinToString(prefix = "Payment{", separator = ", ", postfix = "}")
    }

    public fun copy(
      notification: Notification? = this.notification,
      activation: Activation? = this.activation,
      unknownFields: ByteString = this.unknownFields,
    ): Payment = Payment(notification, activation, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var notification: Notification? = null

      @JvmField
      public var activation: Activation? = null

      public fun notification(notification: Notification?): Builder {
        this.notification = notification
        this.activation = null
        return this
      }

      public fun activation(activation: Activation?): Builder {
        this.activation = activation
        this.notification = null
        return this
      }

      public override fun build(): Payment = Payment(
        notification = notification,
        activation = activation,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        Payment::class, 
        "type.googleapis.com/signalservice.DataMessage.Payment", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: Payment): Int {
          var size = value.unknownFields.size
          size += Notification.ADAPTER.encodedSizeWithTag(1, value.notification)
          size += Activation.ADAPTER.encodedSizeWithTag(2, value.activation)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: Payment): Unit {
          Notification.ADAPTER.encodeWithTag(writer, 1, value.notification)
          Activation.ADAPTER.encodeWithTag(writer, 2, value.activation)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: Payment): Unit {
          writer.writeBytes(value.unknownFields)
          Activation.ADAPTER.encodeWithTag(writer, 2, value.activation)
          Notification.ADAPTER.encodeWithTag(writer, 1, value.notification)
        }

        public override fun decode(reader: ProtoReader): Payment {
          var notification: Notification? = null
          var activation: Activation? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> notification = Notification.ADAPTER.decode(reader)
              2 -> activation = Activation.ADAPTER.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return Payment(
            notification = notification,
            activation = activation,
            unknownFields = unknownFields
          )
        }

        public override fun redact(`value`: Payment): Payment = value.copy(
          notification = value.notification?.let(Notification.ADAPTER::redact),
          activation = value.activation?.let(Activation.ADAPTER::redact),
          unknownFields = ByteString.EMPTY
        )
      }

      private const val serialVersionUID: Long = 0L
    }

    public class Amount(
      @field:WireField(
        tag = 1,
        adapter =
            "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Payment${'$'}Amount${'$'}MobileCoin#ADAPTER",
        oneofName = "Amount",
      )
      @JvmField
      public val mobileCoin: MobileCoin? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      init {
      }

      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.mobileCoin = mobileCoin
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is Amount) return false
        if (unknownFields != other.unknownFields) return false
        if (mobileCoin != other.mobileCoin) return false
        return true
      }

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

      public override fun toString(): String {
        val result = mutableListOf()
        if (mobileCoin != null) result += """mobileCoin=$mobileCoin"""
        return result.joinToString(prefix = "Amount{", separator = ", ", postfix = "}")
      }

      public fun copy(mobileCoin: MobileCoin? = this.mobileCoin, unknownFields: ByteString =
          this.unknownFields): Amount = Amount(mobileCoin, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var mobileCoin: MobileCoin? = null

        public fun mobileCoin(mobileCoin: MobileCoin?): Builder {
          this.mobileCoin = mobileCoin
          return this
        }

        public override fun build(): Amount = Amount(
          mobileCoin = mobileCoin,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          Amount::class, 
          "type.googleapis.com/signalservice.DataMessage.Payment.Amount", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: Amount): Int {
            var size = value.unknownFields.size
            size += MobileCoin.ADAPTER.encodedSizeWithTag(1, value.mobileCoin)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: Amount): Unit {
            MobileCoin.ADAPTER.encodeWithTag(writer, 1, value.mobileCoin)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: Amount): Unit {
            writer.writeBytes(value.unknownFields)
            MobileCoin.ADAPTER.encodeWithTag(writer, 1, value.mobileCoin)
          }

          public override fun decode(reader: ProtoReader): Amount {
            var mobileCoin: MobileCoin? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> mobileCoin = MobileCoin.ADAPTER.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return Amount(
              mobileCoin = mobileCoin,
              unknownFields = unknownFields
            )
          }

          public override fun redact(`value`: Amount): Amount = value.copy(
            mobileCoin = value.mobileCoin?.let(MobileCoin.ADAPTER::redact),
            unknownFields = ByteString.EMPTY
          )
        }

        private const val serialVersionUID: Long = 0L
      }

      public class MobileCoin(
        @field:WireField(
          tag = 1,
          adapter = "com.squareup.wire.ProtoAdapter#UINT64",
        )
        @JvmField
        public val picoMob: Long? = null,
        unknownFields: ByteString = ByteString.EMPTY,
      ) : Message(ADAPTER, unknownFields) {
        public override fun newBuilder(): Builder {
          val builder = Builder()
          builder.picoMob = picoMob
          builder.addUnknownFields(unknownFields)
          return builder
        }

        public override fun equals(other: Any?): Boolean {
          if (other === this) return true
          if (other !is MobileCoin) return false
          if (unknownFields != other.unknownFields) return false
          if (picoMob != other.picoMob) return false
          return true
        }

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

        public override fun toString(): String {
          val result = mutableListOf()
          if (picoMob != null) result += """picoMob=$picoMob"""
          return result.joinToString(prefix = "MobileCoin{", separator = ", ", postfix = "}")
        }

        public fun copy(picoMob: Long? = this.picoMob, unknownFields: ByteString =
            this.unknownFields): MobileCoin = MobileCoin(picoMob, unknownFields)

        public class Builder : Message.Builder() {
          @JvmField
          public var picoMob: Long? = null

          public fun picoMob(picoMob: Long?): Builder {
            this.picoMob = picoMob
            return this
          }

          public override fun build(): MobileCoin = MobileCoin(
            picoMob = picoMob,
            unknownFields = buildUnknownFields()
          )
        }

        public companion object {
          @JvmField
          public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
            FieldEncoding.LENGTH_DELIMITED, 
            MobileCoin::class, 
            "type.googleapis.com/signalservice.DataMessage.Payment.Amount.MobileCoin", 
            PROTO_2, 
            null, 
            "SignalService.proto"
          ) {
            public override fun encodedSize(`value`: MobileCoin): Int {
              var size = value.unknownFields.size
              size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.picoMob)
              return size
            }

            public override fun encode(writer: ProtoWriter, `value`: MobileCoin): Unit {
              ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.picoMob)
              writer.writeBytes(value.unknownFields)
            }

            public override fun encode(writer: ReverseProtoWriter, `value`: MobileCoin): Unit {
              writer.writeBytes(value.unknownFields)
              ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.picoMob)
            }

            public override fun decode(reader: ProtoReader): MobileCoin {
              var picoMob: Long? = null
              val unknownFields = reader.forEachTag { tag ->
                when (tag) {
                  1 -> picoMob = ProtoAdapter.UINT64.decode(reader)
                  else -> reader.readUnknownField(tag)
                }
              }
              return MobileCoin(
                picoMob = picoMob,
                unknownFields = unknownFields
              )
            }

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

          private const val serialVersionUID: Long = 0L
        }
      }
    }

    public class Notification(
      @field:WireField(
        tag = 1,
        adapter =
            "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Payment${'$'}Notification${'$'}MobileCoin#ADAPTER",
        oneofName = "Transaction",
      )
      @JvmField
      public val mobileCoin: MobileCoin? = null,
      @field:WireField(
        tag = 2,
        adapter = "com.squareup.wire.ProtoAdapter#STRING",
      )
      @JvmField
      public val note: String? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      init {
      }

      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.mobileCoin = mobileCoin
        builder.note = note
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is Notification) return false
        if (unknownFields != other.unknownFields) return false
        if (mobileCoin != other.mobileCoin) return false
        if (note != other.note) return false
        return true
      }

      public override fun hashCode(): Int {
        var result = super.hashCode
        if (result == 0) {
          result = unknownFields.hashCode()
          result = result * 37 + (mobileCoin?.hashCode() ?: 0)
          result = result * 37 + (note?.hashCode() ?: 0)
          super.hashCode = result
        }
        return result
      }

      public override fun toString(): String {
        val result = mutableListOf()
        if (mobileCoin != null) result += """mobileCoin=$mobileCoin"""
        if (note != null) result += """note=${sanitize(note)}"""
        return result.joinToString(prefix = "Notification{", separator = ", ", postfix = "}")
      }

      public fun copy(
        mobileCoin: MobileCoin? = this.mobileCoin,
        note: String? = this.note,
        unknownFields: ByteString = this.unknownFields,
      ): Notification = Notification(mobileCoin, note, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var mobileCoin: MobileCoin? = null

        @JvmField
        public var note: String? = null

        public fun note(note: String?): Builder {
          this.note = note
          return this
        }

        public fun mobileCoin(mobileCoin: MobileCoin?): Builder {
          this.mobileCoin = mobileCoin
          return this
        }

        public override fun build(): Notification = Notification(
          mobileCoin = mobileCoin,
          note = note,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          Notification::class, 
          "type.googleapis.com/signalservice.DataMessage.Payment.Notification", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: Notification): Int {
            var size = value.unknownFields.size
            size += MobileCoin.ADAPTER.encodedSizeWithTag(1, value.mobileCoin)
            size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.note)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: Notification): Unit {
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.note)
            MobileCoin.ADAPTER.encodeWithTag(writer, 1, value.mobileCoin)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: Notification): Unit {
            writer.writeBytes(value.unknownFields)
            MobileCoin.ADAPTER.encodeWithTag(writer, 1, value.mobileCoin)
            ProtoAdapter.STRING.encodeWithTag(writer, 2, value.note)
          }

          public override fun decode(reader: ProtoReader): Notification {
            var mobileCoin: MobileCoin? = null
            var note: String? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> mobileCoin = MobileCoin.ADAPTER.decode(reader)
                2 -> note = ProtoAdapter.STRING.decode(reader)
                else -> reader.readUnknownField(tag)
              }
            }
            return Notification(
              mobileCoin = mobileCoin,
              note = note,
              unknownFields = unknownFields
            )
          }

          public override fun redact(`value`: Notification): Notification = value.copy(
            mobileCoin = value.mobileCoin?.let(MobileCoin.ADAPTER::redact),
            unknownFields = ByteString.EMPTY
          )
        }

        private const val serialVersionUID: Long = 0L
      }

      public class MobileCoin(
        @field:WireField(
          tag = 1,
          adapter = "com.squareup.wire.ProtoAdapter#BYTES",
        )
        @JvmField
        public val receipt: ByteString? = null,
        unknownFields: ByteString = ByteString.EMPTY,
      ) : Message(ADAPTER, unknownFields) {
        public override fun newBuilder(): Builder {
          val builder = Builder()
          builder.receipt = receipt
          builder.addUnknownFields(unknownFields)
          return builder
        }

        public override fun equals(other: Any?): Boolean {
          if (other === this) return true
          if (other !is MobileCoin) return false
          if (unknownFields != other.unknownFields) return false
          if (receipt != other.receipt) return false
          return true
        }

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

        public override fun toString(): String {
          val result = mutableListOf()
          if (receipt != null) result += """receipt=$receipt"""
          return result.joinToString(prefix = "MobileCoin{", separator = ", ", postfix = "}")
        }

        public fun copy(receipt: ByteString? = this.receipt, unknownFields: ByteString =
            this.unknownFields): MobileCoin = MobileCoin(receipt, unknownFields)

        public class Builder : Message.Builder() {
          @JvmField
          public var receipt: ByteString? = null

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

          public override fun build(): MobileCoin = MobileCoin(
            receipt = receipt,
            unknownFields = buildUnknownFields()
          )
        }

        public companion object {
          @JvmField
          public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
            FieldEncoding.LENGTH_DELIMITED, 
            MobileCoin::class, 
            "type.googleapis.com/signalservice.DataMessage.Payment.Notification.MobileCoin", 
            PROTO_2, 
            null, 
            "SignalService.proto"
          ) {
            public override fun encodedSize(`value`: MobileCoin): Int {
              var size = value.unknownFields.size
              size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.receipt)
              return size
            }

            public override fun encode(writer: ProtoWriter, `value`: MobileCoin): Unit {
              ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.receipt)
              writer.writeBytes(value.unknownFields)
            }

            public override fun encode(writer: ReverseProtoWriter, `value`: MobileCoin): Unit {
              writer.writeBytes(value.unknownFields)
              ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.receipt)
            }

            public override fun decode(reader: ProtoReader): MobileCoin {
              var receipt: ByteString? = null
              val unknownFields = reader.forEachTag { tag ->
                when (tag) {
                  1 -> receipt = ProtoAdapter.BYTES.decode(reader)
                  else -> reader.readUnknownField(tag)
                }
              }
              return MobileCoin(
                receipt = receipt,
                unknownFields = unknownFields
              )
            }

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

          private const val serialVersionUID: Long = 0L
        }
      }
    }

    public class Activation(
      @field:WireField(
        tag = 1,
        adapter =
            "org.whispersystems.signalservice.internal.push.DataMessage${'$'}Payment${'$'}Activation${'$'}Type#ADAPTER",
      )
      @JvmField
      public val type: Type? = null,
      unknownFields: ByteString = ByteString.EMPTY,
    ) : Message(ADAPTER, unknownFields) {
      public override fun newBuilder(): Builder {
        val builder = Builder()
        builder.type = type
        builder.addUnknownFields(unknownFields)
        return builder
      }

      public override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is Activation) return false
        if (unknownFields != other.unknownFields) return false
        if (type != other.type) return false
        return true
      }

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

      public override fun toString(): String {
        val result = mutableListOf()
        if (type != null) result += """type=$type"""
        return result.joinToString(prefix = "Activation{", separator = ", ", postfix = "}")
      }

      public fun copy(type: Type? = this.type, unknownFields: ByteString = this.unknownFields):
          Activation = Activation(type, unknownFields)

      public class Builder : Message.Builder() {
        @JvmField
        public var type: Type? = null

        public fun type(type: Type?): Builder {
          this.type = type
          return this
        }

        public override fun build(): Activation = Activation(
          type = type,
          unknownFields = buildUnknownFields()
        )
      }

      public companion object {
        @JvmField
        public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
          FieldEncoding.LENGTH_DELIMITED, 
          Activation::class, 
          "type.googleapis.com/signalservice.DataMessage.Payment.Activation", 
          PROTO_2, 
          null, 
          "SignalService.proto"
        ) {
          public override fun encodedSize(`value`: Activation): Int {
            var size = value.unknownFields.size
            size += Type.ADAPTER.encodedSizeWithTag(1, value.type)
            return size
          }

          public override fun encode(writer: ProtoWriter, `value`: Activation): Unit {
            Type.ADAPTER.encodeWithTag(writer, 1, value.type)
            writer.writeBytes(value.unknownFields)
          }

          public override fun encode(writer: ReverseProtoWriter, `value`: Activation): Unit {
            writer.writeBytes(value.unknownFields)
            Type.ADAPTER.encodeWithTag(writer, 1, value.type)
          }

          public override fun decode(reader: ProtoReader): Activation {
            var type: Type? = null
            val unknownFields = reader.forEachTag { tag ->
              when (tag) {
                1 -> try {
                  type = Type.ADAPTER.decode(reader)
                } catch (e: ProtoAdapter.EnumConstantNotFoundException) {
                  reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
                }
                else -> reader.readUnknownField(tag)
              }
            }
            return Activation(
              type = type,
              unknownFields = unknownFields
            )
          }

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

        private const val serialVersionUID: Long = 0L
      }

      public enum class Type(
        public override val `value`: Int,
      ) : WireEnum {
        REQUEST(0),
        ACTIVATED(1),
        ;

        public companion object {
          @JvmField
          public val ADAPTER: ProtoAdapter = object : EnumAdapter(
            Type::class, 
            PROTO_2, 
            Type.REQUEST
          ) {
            public override fun fromValue(`value`: Int): Type? = Type.fromValue(value)
          }

          @JvmStatic
          public fun fromValue(`value`: Int): Type? = when (value) {
            0 -> REQUEST
            1 -> ACTIVATED
            else -> null
          }
        }
      }
    }
  }

  public class GiftBadge(
    @field:WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    )
    @JvmField
    public val receiptCredentialPresentation: ByteString? = null,
    unknownFields: ByteString = ByteString.EMPTY,
  ) : Message(ADAPTER, unknownFields) {
    public override fun newBuilder(): Builder {
      val builder = Builder()
      builder.receiptCredentialPresentation = receiptCredentialPresentation
      builder.addUnknownFields(unknownFields)
      return builder
    }

    public override fun equals(other: Any?): Boolean {
      if (other === this) return true
      if (other !is GiftBadge) return false
      if (unknownFields != other.unknownFields) return false
      if (receiptCredentialPresentation != other.receiptCredentialPresentation) return false
      return true
    }

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

    public override fun toString(): String {
      val result = mutableListOf()
      if (receiptCredentialPresentation != null) result +=
          """receiptCredentialPresentation=$receiptCredentialPresentation"""
      return result.joinToString(prefix = "GiftBadge{", separator = ", ", postfix = "}")
    }

    public fun copy(receiptCredentialPresentation: ByteString? = this.receiptCredentialPresentation,
        unknownFields: ByteString = this.unknownFields): GiftBadge =
        GiftBadge(receiptCredentialPresentation, unknownFields)

    public class Builder : Message.Builder() {
      @JvmField
      public var receiptCredentialPresentation: ByteString? = null

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

      public override fun build(): GiftBadge = GiftBadge(
        receiptCredentialPresentation = receiptCredentialPresentation,
        unknownFields = buildUnknownFields()
      )
    }

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
        FieldEncoding.LENGTH_DELIMITED, 
        GiftBadge::class, 
        "type.googleapis.com/signalservice.DataMessage.GiftBadge", 
        PROTO_2, 
        null, 
        "SignalService.proto"
      ) {
        public override fun encodedSize(`value`: GiftBadge): Int {
          var size = value.unknownFields.size
          size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.receiptCredentialPresentation)
          return size
        }

        public override fun encode(writer: ProtoWriter, `value`: GiftBadge): Unit {
          ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.receiptCredentialPresentation)
          writer.writeBytes(value.unknownFields)
        }

        public override fun encode(writer: ReverseProtoWriter, `value`: GiftBadge): Unit {
          writer.writeBytes(value.unknownFields)
          ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.receiptCredentialPresentation)
        }

        public override fun decode(reader: ProtoReader): GiftBadge {
          var receiptCredentialPresentation: ByteString? = null
          val unknownFields = reader.forEachTag { tag ->
            when (tag) {
              1 -> receiptCredentialPresentation = ProtoAdapter.BYTES.decode(reader)
              else -> reader.readUnknownField(tag)
            }
          }
          return GiftBadge(
            receiptCredentialPresentation = receiptCredentialPresentation,
            unknownFields = unknownFields
          )
        }

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

      private const val serialVersionUID: Long = 0L
    }
  }

  public enum class ProtocolVersion(
    public override val `value`: Int,
  ) : WireEnum {
    INITIAL(0),
    MESSAGE_TIMERS(1),
    VIEW_ONCE(2),
    VIEW_ONCE_VIDEO(3),
    REACTIONS(4),
    CDN_SELECTOR_ATTACHMENTS(5),
    MENTIONS(6),
    PAYMENTS(7),
    CURRENT(7),
    ;

    public companion object {
      @JvmField
      public val ADAPTER: ProtoAdapter = object : EnumAdapter(
        ProtocolVersion::class, 
        PROTO_2, 
        ProtocolVersion.INITIAL
      ) {
        public override fun fromValue(`value`: Int): ProtocolVersion? =
            ProtocolVersion.fromValue(value)
      }

      @JvmStatic
      public fun fromValue(`value`: Int): ProtocolVersion? = when (value) {
        0 -> INITIAL
        1 -> MESSAGE_TIMERS
        2 -> VIEW_ONCE
        3 -> VIEW_ONCE_VIDEO
        4 -> REACTIONS
        5 -> CDN_SELECTOR_ATTACHMENTS
        6 -> MENTIONS
        7 -> PAYMENTS
        7 -> CURRENT
        else -> null
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy