org.signal.svr2.proto.BackupResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java, unofficial fork
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: BackupResponse 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
public class BackupResponse(
@field:WireField(
tag = 1,
adapter = "org.signal.svr2.proto.BackupResponse${'$'}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 BackupResponse) 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 = "BackupResponse{", separator = ", ", postfix = "}")
}
public fun copy(status: Status = this.status, unknownFields: ByteString = this.unknownFields):
BackupResponse = BackupResponse(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(): BackupResponse = BackupResponse(
status = status,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
BackupResponse::class,
"type.googleapis.com/BackupResponse",
PROTO_3,
null,
"SVR2.proto"
) {
public override fun encodedSize(`value`: BackupResponse): 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`: BackupResponse): Unit {
if (value.status != Status.UNSET) Status.ADAPTER.encodeWithTag(writer, 1, value.status)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: BackupResponse): Unit {
writer.writeBytes(value.unknownFields)
if (value.status != Status.UNSET) Status.ADAPTER.encodeWithTag(writer, 1, value.status)
}
public override fun decode(reader: ProtoReader): BackupResponse {
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 BackupResponse(
status = status,
unknownFields = unknownFields
)
}
public override fun redact(`value`: BackupResponse): BackupResponse = 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 set db\[backup_id\]=data
*/
OK(1),
/**
* the request was not correctly specified
*/
REQUEST_INVALID(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 -> REQUEST_INVALID
else -> null
}
}
}
}