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

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

import com.squareup.wire.FieldEncoding
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.ProtoReader
import com.squareup.wire.ProtoWriter
import com.squareup.wire.ReverseProtoWriter
import com.squareup.wire.Syntax.PROTO_2
import com.squareup.wire.WireField
import 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.jvm.JvmField
import okio.ByteString

public class ProvisionMessage(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val aciIdentityKeyPublic: ByteString? = null,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val aciIdentityKeyPrivate: ByteString? = null,
  @field:WireField(
    tag = 11,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val pniIdentityKeyPublic: ByteString? = null,
  @field:WireField(
    tag = 12,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val pniIdentityKeyPrivate: ByteString? = null,
  @field:WireField(
    tag = 8,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
  )
  @JvmField
  public val aci: String? = null,
  @field:WireField(
    tag = 10,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
  )
  @JvmField
  public val pni: String? = null,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
  )
  @JvmField
  public val number: String? = null,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
  )
  @JvmField
  public val provisioningCode: String? = null,
  @field:WireField(
    tag = 5,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
  )
  @JvmField
  public val userAgent: String? = 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#BOOL",
  )
  @JvmField
  public val readReceipts: Boolean? = null,
  @field:WireField(
    tag = 9,
    adapter = "com.squareup.wire.ProtoAdapter#UINT32",
  )
  @JvmField
  public val provisioningVersion: Int? = null,
  @field:WireField(
    tag = 13,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
  )
  @JvmField
  public val masterKey: ByteString? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.aciIdentityKeyPublic = aciIdentityKeyPublic
    builder.aciIdentityKeyPrivate = aciIdentityKeyPrivate
    builder.pniIdentityKeyPublic = pniIdentityKeyPublic
    builder.pniIdentityKeyPrivate = pniIdentityKeyPrivate
    builder.aci = aci
    builder.pni = pni
    builder.number = number
    builder.provisioningCode = provisioningCode
    builder.userAgent = userAgent
    builder.profileKey = profileKey
    builder.readReceipts = readReceipts
    builder.provisioningVersion = provisioningVersion
    builder.masterKey = masterKey
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is ProvisionMessage) return false
    if (unknownFields != other.unknownFields) return false
    if (aciIdentityKeyPublic != other.aciIdentityKeyPublic) return false
    if (aciIdentityKeyPrivate != other.aciIdentityKeyPrivate) return false
    if (pniIdentityKeyPublic != other.pniIdentityKeyPublic) return false
    if (pniIdentityKeyPrivate != other.pniIdentityKeyPrivate) return false
    if (aci != other.aci) return false
    if (pni != other.pni) return false
    if (number != other.number) return false
    if (provisioningCode != other.provisioningCode) return false
    if (userAgent != other.userAgent) return false
    if (profileKey != other.profileKey) return false
    if (readReceipts != other.readReceipts) return false
    if (provisioningVersion != other.provisioningVersion) return false
    if (masterKey != other.masterKey) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + (aciIdentityKeyPublic?.hashCode() ?: 0)
      result = result * 37 + (aciIdentityKeyPrivate?.hashCode() ?: 0)
      result = result * 37 + (pniIdentityKeyPublic?.hashCode() ?: 0)
      result = result * 37 + (pniIdentityKeyPrivate?.hashCode() ?: 0)
      result = result * 37 + (aci?.hashCode() ?: 0)
      result = result * 37 + (pni?.hashCode() ?: 0)
      result = result * 37 + (number?.hashCode() ?: 0)
      result = result * 37 + (provisioningCode?.hashCode() ?: 0)
      result = result * 37 + (userAgent?.hashCode() ?: 0)
      result = result * 37 + (profileKey?.hashCode() ?: 0)
      result = result * 37 + (readReceipts?.hashCode() ?: 0)
      result = result * 37 + (provisioningVersion?.hashCode() ?: 0)
      result = result * 37 + (masterKey?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    if (aciIdentityKeyPublic != null) result += """aciIdentityKeyPublic=$aciIdentityKeyPublic"""
    if (aciIdentityKeyPrivate != null) result += """aciIdentityKeyPrivate=$aciIdentityKeyPrivate"""
    if (pniIdentityKeyPublic != null) result += """pniIdentityKeyPublic=$pniIdentityKeyPublic"""
    if (pniIdentityKeyPrivate != null) result += """pniIdentityKeyPrivate=$pniIdentityKeyPrivate"""
    if (aci != null) result += """aci=${sanitize(aci)}"""
    if (pni != null) result += """pni=${sanitize(pni)}"""
    if (number != null) result += """number=${sanitize(number)}"""
    if (provisioningCode != null) result += """provisioningCode=${sanitize(provisioningCode)}"""
    if (userAgent != null) result += """userAgent=${sanitize(userAgent)}"""
    if (profileKey != null) result += """profileKey=$profileKey"""
    if (readReceipts != null) result += """readReceipts=$readReceipts"""
    if (provisioningVersion != null) result += """provisioningVersion=$provisioningVersion"""
    if (masterKey != null) result += """masterKey=$masterKey"""
    return result.joinToString(prefix = "ProvisionMessage{", separator = ", ", postfix = "}")
  }

  public fun copy(
    aciIdentityKeyPublic: ByteString? = this.aciIdentityKeyPublic,
    aciIdentityKeyPrivate: ByteString? = this.aciIdentityKeyPrivate,
    pniIdentityKeyPublic: ByteString? = this.pniIdentityKeyPublic,
    pniIdentityKeyPrivate: ByteString? = this.pniIdentityKeyPrivate,
    aci: String? = this.aci,
    pni: String? = this.pni,
    number: String? = this.number,
    provisioningCode: String? = this.provisioningCode,
    userAgent: String? = this.userAgent,
    profileKey: ByteString? = this.profileKey,
    readReceipts: Boolean? = this.readReceipts,
    provisioningVersion: Int? = this.provisioningVersion,
    masterKey: ByteString? = this.masterKey,
    unknownFields: ByteString = this.unknownFields,
  ): ProvisionMessage = ProvisionMessage(aciIdentityKeyPublic, aciIdentityKeyPrivate,
      pniIdentityKeyPublic, pniIdentityKeyPrivate, aci, pni, number, provisioningCode, userAgent,
      profileKey, readReceipts, provisioningVersion, masterKey, unknownFields)

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

    @JvmField
    public var aciIdentityKeyPrivate: ByteString? = null

    @JvmField
    public var pniIdentityKeyPublic: ByteString? = null

    @JvmField
    public var pniIdentityKeyPrivate: ByteString? = null

    @JvmField
    public var aci: String? = null

    @JvmField
    public var pni: String? = null

    @JvmField
    public var number: String? = null

    @JvmField
    public var provisioningCode: String? = null

    @JvmField
    public var userAgent: String? = null

    @JvmField
    public var profileKey: ByteString? = null

    @JvmField
    public var readReceipts: Boolean? = null

    @JvmField
    public var provisioningVersion: Int? = null

    @JvmField
    public var masterKey: ByteString? = null

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

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

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

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

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

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

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

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

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

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

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

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

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

    public override fun build(): ProvisionMessage = ProvisionMessage(
      aciIdentityKeyPublic = aciIdentityKeyPublic,
      aciIdentityKeyPrivate = aciIdentityKeyPrivate,
      pniIdentityKeyPublic = pniIdentityKeyPublic,
      pniIdentityKeyPrivate = pniIdentityKeyPrivate,
      aci = aci,
      pni = pni,
      number = number,
      provisioningCode = provisioningCode,
      userAgent = userAgent,
      profileKey = profileKey,
      readReceipts = readReceipts,
      provisioningVersion = provisioningVersion,
      masterKey = masterKey,
      unknownFields = buildUnknownFields()
    )
  }

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      ProvisionMessage::class, 
      "type.googleapis.com/signalservice.ProvisionMessage", 
      PROTO_2, 
      null, 
      "Provisioning.proto"
    ) {
      public override fun encodedSize(`value`: ProvisionMessage): Int {
        var size = value.unknownFields.size
        size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.aciIdentityKeyPublic)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(2, value.aciIdentityKeyPrivate)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(11, value.pniIdentityKeyPublic)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(12, value.pniIdentityKeyPrivate)
        size += ProtoAdapter.STRING.encodedSizeWithTag(8, value.aci)
        size += ProtoAdapter.STRING.encodedSizeWithTag(10, value.pni)
        size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.number)
        size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.provisioningCode)
        size += ProtoAdapter.STRING.encodedSizeWithTag(5, value.userAgent)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(6, value.profileKey)
        size += ProtoAdapter.BOOL.encodedSizeWithTag(7, value.readReceipts)
        size += ProtoAdapter.UINT32.encodedSizeWithTag(9, value.provisioningVersion)
        size += ProtoAdapter.BYTES.encodedSizeWithTag(13, value.masterKey)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: ProvisionMessage): Unit {
        ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.aciIdentityKeyPublic)
        ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.aciIdentityKeyPrivate)
        ProtoAdapter.BYTES.encodeWithTag(writer, 11, value.pniIdentityKeyPublic)
        ProtoAdapter.BYTES.encodeWithTag(writer, 12, value.pniIdentityKeyPrivate)
        ProtoAdapter.STRING.encodeWithTag(writer, 8, value.aci)
        ProtoAdapter.STRING.encodeWithTag(writer, 10, value.pni)
        ProtoAdapter.STRING.encodeWithTag(writer, 3, value.number)
        ProtoAdapter.STRING.encodeWithTag(writer, 4, value.provisioningCode)
        ProtoAdapter.STRING.encodeWithTag(writer, 5, value.userAgent)
        ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.profileKey)
        ProtoAdapter.BOOL.encodeWithTag(writer, 7, value.readReceipts)
        ProtoAdapter.UINT32.encodeWithTag(writer, 9, value.provisioningVersion)
        ProtoAdapter.BYTES.encodeWithTag(writer, 13, value.masterKey)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: ProvisionMessage): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.BYTES.encodeWithTag(writer, 13, value.masterKey)
        ProtoAdapter.UINT32.encodeWithTag(writer, 9, value.provisioningVersion)
        ProtoAdapter.BOOL.encodeWithTag(writer, 7, value.readReceipts)
        ProtoAdapter.BYTES.encodeWithTag(writer, 6, value.profileKey)
        ProtoAdapter.STRING.encodeWithTag(writer, 5, value.userAgent)
        ProtoAdapter.STRING.encodeWithTag(writer, 4, value.provisioningCode)
        ProtoAdapter.STRING.encodeWithTag(writer, 3, value.number)
        ProtoAdapter.STRING.encodeWithTag(writer, 10, value.pni)
        ProtoAdapter.STRING.encodeWithTag(writer, 8, value.aci)
        ProtoAdapter.BYTES.encodeWithTag(writer, 12, value.pniIdentityKeyPrivate)
        ProtoAdapter.BYTES.encodeWithTag(writer, 11, value.pniIdentityKeyPublic)
        ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.aciIdentityKeyPrivate)
        ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.aciIdentityKeyPublic)
      }

      public override fun decode(reader: ProtoReader): ProvisionMessage {
        var aciIdentityKeyPublic: ByteString? = null
        var aciIdentityKeyPrivate: ByteString? = null
        var pniIdentityKeyPublic: ByteString? = null
        var pniIdentityKeyPrivate: ByteString? = null
        var aci: String? = null
        var pni: String? = null
        var number: String? = null
        var provisioningCode: String? = null
        var userAgent: String? = null
        var profileKey: ByteString? = null
        var readReceipts: Boolean? = null
        var provisioningVersion: Int? = null
        var masterKey: ByteString? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> aciIdentityKeyPublic = ProtoAdapter.BYTES.decode(reader)
            2 -> aciIdentityKeyPrivate = ProtoAdapter.BYTES.decode(reader)
            11 -> pniIdentityKeyPublic = ProtoAdapter.BYTES.decode(reader)
            12 -> pniIdentityKeyPrivate = ProtoAdapter.BYTES.decode(reader)
            8 -> aci = ProtoAdapter.STRING.decode(reader)
            10 -> pni = ProtoAdapter.STRING.decode(reader)
            3 -> number = ProtoAdapter.STRING.decode(reader)
            4 -> provisioningCode = ProtoAdapter.STRING.decode(reader)
            5 -> userAgent = ProtoAdapter.STRING.decode(reader)
            6 -> profileKey = ProtoAdapter.BYTES.decode(reader)
            7 -> readReceipts = ProtoAdapter.BOOL.decode(reader)
            9 -> provisioningVersion = ProtoAdapter.UINT32.decode(reader)
            13 -> masterKey = ProtoAdapter.BYTES.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return ProvisionMessage(
          aciIdentityKeyPublic = aciIdentityKeyPublic,
          aciIdentityKeyPrivate = aciIdentityKeyPrivate,
          pniIdentityKeyPublic = pniIdentityKeyPublic,
          pniIdentityKeyPrivate = pniIdentityKeyPrivate,
          aci = aci,
          pni = pni,
          number = number,
          provisioningCode = provisioningCode,
          userAgent = userAgent,
          profileKey = profileKey,
          readReceipts = readReceipts,
          provisioningVersion = provisioningVersion,
          masterKey = masterKey,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy