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

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

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_3
import com.squareup.wire.WireEnum
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 kotlin.jvm.JvmStatic
import okio.ByteString

/**
 *
 * expose
 */
public class ExposeResponse(
  @field:WireField(
    tag = 1,
    adapter = "org.signal.svr2.proto.ExposeResponse${'$'}Status#ADAPTER",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val status: Status = Status.UNSET,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  public override fun newBuilder(): Builder {
    val builder = Builder()
    builder.status = status
    builder.addUnknownFields(unknownFields)
    return builder
  }

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

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

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

  public fun copy(status: Status = this.status, unknownFields: ByteString = this.unknownFields):
      ExposeResponse = ExposeResponse(status, unknownFields)

  public class Builder : Message.Builder() {
    @JvmField
    public var status: Status = Status.UNSET

    public fun status(status: Status): Builder {
      this.status = status
      return this
    }

    public override fun build(): ExposeResponse = ExposeResponse(
      status = status,
      unknownFields = buildUnknownFields()
    )
  }

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

      public override fun encode(writer: ProtoWriter, `value`: ExposeResponse): Unit {
        if (value.status != Status.UNSET) Status.ADAPTER.encodeWithTag(writer, 1, value.status)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: ExposeResponse): Unit {
        writer.writeBytes(value.unknownFields)
        if (value.status != Status.UNSET) Status.ADAPTER.encodeWithTag(writer, 1, value.status)
      }

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

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

    private const val serialVersionUID: Long = 0L
  }

  public enum class Status(
    public override val `value`: Int,
  ) : WireEnum {
    /**
     * never returned
     */
    UNSET(0),
    /**
     * successfully restored, \[data\] will be set
     */
    OK(1),
    /**
     * If this status comes back after a successful Backup() call,
     * this should be cause for concern.
     * It means that someone has either reset, deleted, or tried to brute-force
     * the backup since it was created.
     */
    ERROR(2),
    ;

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

      @JvmStatic
      public fun fromValue(`value`: Int): Status? = when (value) {
        0 -> UNSET
        1 -> OK
        2 -> ERROR
        else -> null
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy