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

org.signal.svr2.proto.BackupRequest.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: BackupRequest in SVR2.proto
package org.signal.svr2.proto

import com.squareup.wire.FieldEncoding
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.ProtoReader
import com.squareup.wire.ProtoWriter
import com.squareup.wire.ReverseProtoWriter
import com.squareup.wire.Syntax.PROTO_3
import com.squareup.wire.WireField
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.jvm.JvmField
import okio.ByteString

/**
 *
 * backup
 */
public class BackupRequest(
  /**
   * between 16 and 48 bytes
   */
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    label = WireField.Label.OMIT_IDENTITY,
    declaredName = "data",
  )
  @JvmField
  public val data_: ByteString = ByteString.EMPTY,
  /**
   * 32 bytes
   */
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val pin: ByteString = ByteString.EMPTY,
  /**
   * in range \[1,255\]
   */
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#UINT32",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val maxTries: Int = 0,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.data_ = data_
    builder.pin = pin
    builder.maxTries = maxTries
    builder.addUnknownFields(unknownFields)
    return builder
  }

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is BackupRequest) return false
    if (unknownFields != other.unknownFields) return false
    if (data_ != other.data_) return false
    if (pin != other.pin) return false
    if (maxTries != other.maxTries) return false
    return true
  }

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

  public override fun toString(): String {
    val result = mutableListOf()
    result += """data_=$data_"""
    result += """pin=$pin"""
    result += """maxTries=$maxTries"""
    return result.joinToString(prefix = "BackupRequest{", separator = ", ", postfix = "}")
  }

  public fun copy(
    data_: ByteString = this.data_,
    pin: ByteString = this.pin,
    maxTries: Int = this.maxTries,
    unknownFields: ByteString = this.unknownFields,
  ): BackupRequest = BackupRequest(data_, pin, maxTries, unknownFields)

  public class Builder : Message.Builder() {
    @JvmField
    public var data_: ByteString = ByteString.EMPTY

    @JvmField
    public var pin: ByteString = ByteString.EMPTY

    @JvmField
    public var maxTries: Int = 0

    /**
     * between 16 and 48 bytes
     */
    public fun data_(data_: ByteString): Builder {
      this.data_ = data_
      return this
    }

    /**
     * 32 bytes
     */
    public fun pin(pin: ByteString): Builder {
      this.pin = pin
      return this
    }

    /**
     * in range \[1,255\]
     */
    public fun maxTries(maxTries: Int): Builder {
      this.maxTries = maxTries
      return this
    }

    public override fun build(): BackupRequest = BackupRequest(
      data_ = data_,
      pin = pin,
      maxTries = maxTries,
      unknownFields = buildUnknownFields()
    )
  }

  public companion object {
    @JvmField
    public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      BackupRequest::class, 
      "type.googleapis.com/BackupRequest", 
      PROTO_3, 
      null, 
      "SVR2.proto"
    ) {
      public override fun encodedSize(`value`: BackupRequest): Int {
        var size = value.unknownFields.size
        if (value.data_ != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(1,
            value.data_)
        if (value.pin != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(2,
            value.pin)
        if (value.maxTries != 0) size += ProtoAdapter.UINT32.encodedSizeWithTag(3, value.maxTries)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: BackupRequest): Unit {
        if (value.data_ != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1,
            value.data_)
        if (value.pin != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.pin)
        if (value.maxTries != 0) ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.maxTries)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: BackupRequest): Unit {
        writer.writeBytes(value.unknownFields)
        if (value.maxTries != 0) ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.maxTries)
        if (value.pin != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.pin)
        if (value.data_ != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1,
            value.data_)
      }

      public override fun decode(reader: ProtoReader): BackupRequest {
        var data_: ByteString = ByteString.EMPTY
        var pin: ByteString = ByteString.EMPTY
        var maxTries: Int = 0
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> data_ = ProtoAdapter.BYTES.decode(reader)
            2 -> pin = ProtoAdapter.BYTES.decode(reader)
            3 -> maxTries = ProtoAdapter.UINT32.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return BackupRequest(
          data_ = data_,
          pin = pin,
          maxTries = maxTries,
          unknownFields = unknownFields
        )
      }

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy