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

org.signal.svr2.proto.RestoreRequest.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: RestoreRequest 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

/**
 *
 * restore
 */
public class RestoreRequest(
  /**
   * 32 bytes
   */
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val pin: ByteString = ByteString.EMPTY,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.pin = pin
    builder.addUnknownFields(unknownFields)
    return builder
  }

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

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

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

  public fun copy(pin: ByteString = this.pin, unknownFields: ByteString = this.unknownFields):
      RestoreRequest = RestoreRequest(pin, unknownFields)

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

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

    public override fun build(): RestoreRequest = RestoreRequest(
      pin = pin,
      unknownFields = buildUnknownFields()
    )
  }

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

      public override fun encode(writer: ProtoWriter, `value`: RestoreRequest): Unit {
        if (value.pin != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.pin)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: RestoreRequest): Unit {
        writer.writeBytes(value.unknownFields)
        if (value.pin != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.pin)
      }

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

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

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy