org.signal.cdsi.proto.EnclaveLoad.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: org.signal.cdsi.EnclaveLoad in CDSI.proto
package org.signal.cdsi.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
public class EnclaveLoad(
/**
* If set, before loading any tuples entirely clear the current map,
* zero'ing out all current data.
*/
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#BOOL",
label = WireField.Label.OMIT_IDENTITY,
)
@JvmField
public val clearAll: Boolean = false,
/**
* Each tuple is an 8-byte e164, a 16-byte PNI, a 16-byte ACI, and a
* 16-byte UAK. These should be loaded as a 48-byte value (PNI,ACI,UAK)
* associated with an 8-byte key (e164).
* ACI/PNI/UAK may all be zeros, in which case this is a delete of the e164.
*/
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
label = WireField.Label.OMIT_IDENTITY,
)
@JvmField
public val e164AciPniUakTuples: ByteString = ByteString.EMPTY,
/**
* If non-empty, overwrite the shared token secret with this value.
*/
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
label = WireField.Label.OMIT_IDENTITY,
)
@JvmField
public val sharedTokenSecret: ByteString = ByteString.EMPTY,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.clearAll = clearAll
builder.e164AciPniUakTuples = e164AciPniUakTuples
builder.sharedTokenSecret = sharedTokenSecret
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is EnclaveLoad) return false
if (unknownFields != other.unknownFields) return false
if (clearAll != other.clearAll) return false
if (e164AciPniUakTuples != other.e164AciPniUakTuples) return false
if (sharedTokenSecret != other.sharedTokenSecret) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + clearAll.hashCode()
result = result * 37 + e164AciPniUakTuples.hashCode()
result = result * 37 + sharedTokenSecret.hashCode()
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
result += """clearAll=$clearAll"""
result += """e164AciPniUakTuples=$e164AciPniUakTuples"""
result += """sharedTokenSecret=$sharedTokenSecret"""
return result.joinToString(prefix = "EnclaveLoad{", separator = ", ", postfix = "}")
}
public fun copy(
clearAll: Boolean = this.clearAll,
e164AciPniUakTuples: ByteString = this.e164AciPniUakTuples,
sharedTokenSecret: ByteString = this.sharedTokenSecret,
unknownFields: ByteString = this.unknownFields,
): EnclaveLoad = EnclaveLoad(clearAll, e164AciPniUakTuples, sharedTokenSecret, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var clearAll: Boolean = false
@JvmField
public var e164AciPniUakTuples: ByteString = ByteString.EMPTY
@JvmField
public var sharedTokenSecret: ByteString = ByteString.EMPTY
/**
* If set, before loading any tuples entirely clear the current map,
* zero'ing out all current data.
*/
public fun clearAll(clearAll: Boolean): Builder {
this.clearAll = clearAll
return this
}
/**
* Each tuple is an 8-byte e164, a 16-byte PNI, a 16-byte ACI, and a
* 16-byte UAK. These should be loaded as a 48-byte value (PNI,ACI,UAK)
* associated with an 8-byte key (e164).
* ACI/PNI/UAK may all be zeros, in which case this is a delete of the e164.
*/
public fun e164AciPniUakTuples(e164AciPniUakTuples: ByteString): Builder {
this.e164AciPniUakTuples = e164AciPniUakTuples
return this
}
/**
* If non-empty, overwrite the shared token secret with this value.
*/
public fun sharedTokenSecret(sharedTokenSecret: ByteString): Builder {
this.sharedTokenSecret = sharedTokenSecret
return this
}
public override fun build(): EnclaveLoad = EnclaveLoad(
clearAll = clearAll,
e164AciPniUakTuples = e164AciPniUakTuples,
sharedTokenSecret = sharedTokenSecret,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
EnclaveLoad::class,
"type.googleapis.com/org.signal.cdsi.EnclaveLoad",
PROTO_3,
null,
"CDSI.proto"
) {
public override fun encodedSize(`value`: EnclaveLoad): Int {
var size = value.unknownFields.size
if (value.clearAll != false) size += ProtoAdapter.BOOL.encodedSizeWithTag(1, value.clearAll)
if (value.e164AciPniUakTuples != ByteString.EMPTY) size +=
ProtoAdapter.BYTES.encodedSizeWithTag(2, value.e164AciPniUakTuples)
if (value.sharedTokenSecret != ByteString.EMPTY) size +=
ProtoAdapter.BYTES.encodedSizeWithTag(3, value.sharedTokenSecret)
return size
}
public override fun encode(writer: ProtoWriter, `value`: EnclaveLoad): Unit {
if (value.clearAll != false) ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.clearAll)
if (value.e164AciPniUakTuples != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer,
2, value.e164AciPniUakTuples)
if (value.sharedTokenSecret != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 3,
value.sharedTokenSecret)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: EnclaveLoad): Unit {
writer.writeBytes(value.unknownFields)
if (value.sharedTokenSecret != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 3,
value.sharedTokenSecret)
if (value.e164AciPniUakTuples != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer,
2, value.e164AciPniUakTuples)
if (value.clearAll != false) ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.clearAll)
}
public override fun decode(reader: ProtoReader): EnclaveLoad {
var clearAll: Boolean = false
var e164AciPniUakTuples: ByteString = ByteString.EMPTY
var sharedTokenSecret: ByteString = ByteString.EMPTY
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> clearAll = ProtoAdapter.BOOL.decode(reader)
2 -> e164AciPniUakTuples = ProtoAdapter.BYTES.decode(reader)
3 -> sharedTokenSecret = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return EnclaveLoad(
clearAll = clearAll,
e164AciPniUakTuples = e164AciPniUakTuples,
sharedTokenSecret = sharedTokenSecret,
unknownFields = unknownFields
)
}
public override fun redact(`value`: EnclaveLoad): EnclaveLoad = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}