org.whispersystems.signalservice.internal.push.CallMessage.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: signalservice.CallMessage in SignalService.proto
package org.whispersystems.signalservice.`internal`.push
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_2
import com.squareup.wire.WireEnum
import com.squareup.wire.WireField
import com.squareup.wire.`internal`.checkElementsNotNull
import com.squareup.wire.`internal`.immutableCopyOf
import com.squareup.wire.`internal`.redactElements
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmField
import kotlin.jvm.JvmStatic
import okio.ByteString
public class CallMessage(
@field:WireField(
tag = 1,
adapter = "org.whispersystems.signalservice.internal.push.CallMessage${'$'}Offer#ADAPTER",
)
@JvmField
public val offer: Offer? = null,
@field:WireField(
tag = 2,
adapter = "org.whispersystems.signalservice.internal.push.CallMessage${'$'}Answer#ADAPTER",
)
@JvmField
public val answer: Answer? = null,
iceUpdate: List = emptyList(),
@field:WireField(
tag = 5,
adapter = "org.whispersystems.signalservice.internal.push.CallMessage${'$'}Busy#ADAPTER",
)
@JvmField
public val busy: Busy? = null,
@field:WireField(
tag = 7,
adapter = "org.whispersystems.signalservice.internal.push.CallMessage${'$'}Hangup#ADAPTER",
)
@JvmField
public val hangup: Hangup? = null,
@field:WireField(
tag = 9,
adapter = "com.squareup.wire.ProtoAdapter#UINT32",
)
@JvmField
public val destinationDeviceId: Int? = null,
@field:WireField(
tag = 10,
adapter = "org.whispersystems.signalservice.internal.push.CallMessage${'$'}Opaque#ADAPTER",
)
@JvmField
public val opaque: Opaque? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
@field:WireField(
tag = 3,
adapter = "org.whispersystems.signalservice.internal.push.CallMessage${'$'}IceUpdate#ADAPTER",
label = WireField.Label.REPEATED,
)
@JvmField
public val iceUpdate: List = immutableCopyOf("iceUpdate", iceUpdate)
public override fun newBuilder(): Builder {
val builder = Builder()
builder.offer = offer
builder.answer = answer
builder.iceUpdate = iceUpdate
builder.busy = busy
builder.hangup = hangup
builder.destinationDeviceId = destinationDeviceId
builder.opaque = opaque
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is CallMessage) return false
if (unknownFields != other.unknownFields) return false
if (offer != other.offer) return false
if (answer != other.answer) return false
if (iceUpdate != other.iceUpdate) return false
if (busy != other.busy) return false
if (hangup != other.hangup) return false
if (destinationDeviceId != other.destinationDeviceId) return false
if (opaque != other.opaque) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (offer?.hashCode() ?: 0)
result = result * 37 + (answer?.hashCode() ?: 0)
result = result * 37 + iceUpdate.hashCode()
result = result * 37 + (busy?.hashCode() ?: 0)
result = result * 37 + (hangup?.hashCode() ?: 0)
result = result * 37 + (destinationDeviceId?.hashCode() ?: 0)
result = result * 37 + (opaque?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (offer != null) result += """offer=$offer"""
if (answer != null) result += """answer=$answer"""
if (iceUpdate.isNotEmpty()) result += """iceUpdate=$iceUpdate"""
if (busy != null) result += """busy=$busy"""
if (hangup != null) result += """hangup=$hangup"""
if (destinationDeviceId != null) result += """destinationDeviceId=$destinationDeviceId"""
if (opaque != null) result += """opaque=$opaque"""
return result.joinToString(prefix = "CallMessage{", separator = ", ", postfix = "}")
}
public fun copy(
offer: Offer? = this.offer,
answer: Answer? = this.answer,
iceUpdate: List = this.iceUpdate,
busy: Busy? = this.busy,
hangup: Hangup? = this.hangup,
destinationDeviceId: Int? = this.destinationDeviceId,
opaque: Opaque? = this.opaque,
unknownFields: ByteString = this.unknownFields,
): CallMessage = CallMessage(offer, answer, iceUpdate, busy, hangup, destinationDeviceId, opaque,
unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var offer: Offer? = null
@JvmField
public var answer: Answer? = null
@JvmField
public var iceUpdate: List = emptyList()
@JvmField
public var busy: Busy? = null
@JvmField
public var hangup: Hangup? = null
@JvmField
public var destinationDeviceId: Int? = null
@JvmField
public var opaque: Opaque? = null
public fun offer(offer: Offer?): Builder {
this.offer = offer
return this
}
public fun answer(answer: Answer?): Builder {
this.answer = answer
return this
}
public fun iceUpdate(iceUpdate: List): Builder {
checkElementsNotNull(iceUpdate)
this.iceUpdate = iceUpdate
return this
}
public fun busy(busy: Busy?): Builder {
this.busy = busy
return this
}
public fun hangup(hangup: Hangup?): Builder {
this.hangup = hangup
return this
}
public fun destinationDeviceId(destinationDeviceId: Int?): Builder {
this.destinationDeviceId = destinationDeviceId
return this
}
public fun opaque(opaque: Opaque?): Builder {
this.opaque = opaque
return this
}
public override fun build(): CallMessage = CallMessage(
offer = offer,
answer = answer,
iceUpdate = iceUpdate,
busy = busy,
hangup = hangup,
destinationDeviceId = destinationDeviceId,
opaque = opaque,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
CallMessage::class,
"type.googleapis.com/signalservice.CallMessage",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: CallMessage): Int {
var size = value.unknownFields.size
size += Offer.ADAPTER.encodedSizeWithTag(1, value.offer)
size += Answer.ADAPTER.encodedSizeWithTag(2, value.answer)
size += IceUpdate.ADAPTER.asRepeated().encodedSizeWithTag(3, value.iceUpdate)
size += Busy.ADAPTER.encodedSizeWithTag(5, value.busy)
size += Hangup.ADAPTER.encodedSizeWithTag(7, value.hangup)
size += ProtoAdapter.UINT32.encodedSizeWithTag(9, value.destinationDeviceId)
size += Opaque.ADAPTER.encodedSizeWithTag(10, value.opaque)
return size
}
public override fun encode(writer: ProtoWriter, `value`: CallMessage): Unit {
Offer.ADAPTER.encodeWithTag(writer, 1, value.offer)
Answer.ADAPTER.encodeWithTag(writer, 2, value.answer)
IceUpdate.ADAPTER.asRepeated().encodeWithTag(writer, 3, value.iceUpdate)
Busy.ADAPTER.encodeWithTag(writer, 5, value.busy)
Hangup.ADAPTER.encodeWithTag(writer, 7, value.hangup)
ProtoAdapter.UINT32.encodeWithTag(writer, 9, value.destinationDeviceId)
Opaque.ADAPTER.encodeWithTag(writer, 10, value.opaque)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: CallMessage): Unit {
writer.writeBytes(value.unknownFields)
Opaque.ADAPTER.encodeWithTag(writer, 10, value.opaque)
ProtoAdapter.UINT32.encodeWithTag(writer, 9, value.destinationDeviceId)
Hangup.ADAPTER.encodeWithTag(writer, 7, value.hangup)
Busy.ADAPTER.encodeWithTag(writer, 5, value.busy)
IceUpdate.ADAPTER.asRepeated().encodeWithTag(writer, 3, value.iceUpdate)
Answer.ADAPTER.encodeWithTag(writer, 2, value.answer)
Offer.ADAPTER.encodeWithTag(writer, 1, value.offer)
}
public override fun decode(reader: ProtoReader): CallMessage {
var offer: Offer? = null
var answer: Answer? = null
val iceUpdate = mutableListOf()
var busy: Busy? = null
var hangup: Hangup? = null
var destinationDeviceId: Int? = null
var opaque: Opaque? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> offer = Offer.ADAPTER.decode(reader)
2 -> answer = Answer.ADAPTER.decode(reader)
3 -> iceUpdate.add(IceUpdate.ADAPTER.decode(reader))
5 -> busy = Busy.ADAPTER.decode(reader)
7 -> hangup = Hangup.ADAPTER.decode(reader)
9 -> destinationDeviceId = ProtoAdapter.UINT32.decode(reader)
10 -> opaque = Opaque.ADAPTER.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return CallMessage(
offer = offer,
answer = answer,
iceUpdate = iceUpdate,
busy = busy,
hangup = hangup,
destinationDeviceId = destinationDeviceId,
opaque = opaque,
unknownFields = unknownFields
)
}
public override fun redact(`value`: CallMessage): CallMessage = value.copy(
offer = value.offer?.let(Offer.ADAPTER::redact),
answer = value.answer?.let(Answer.ADAPTER::redact),
iceUpdate = value.iceUpdate.redactElements(IceUpdate.ADAPTER),
busy = value.busy?.let(Busy.ADAPTER::redact),
hangup = value.hangup?.let(Hangup.ADAPTER::redact),
opaque = value.opaque?.let(Opaque.ADAPTER::redact),
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
public class Offer(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#UINT64",
)
@JvmField
public val id: Long? = null,
@field:WireField(
tag = 3,
adapter =
"org.whispersystems.signalservice.internal.push.CallMessage${'$'}Offer${'$'}Type#ADAPTER",
)
@JvmField
public val type: Type? = null,
@field:WireField(
tag = 4,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val opaque: ByteString? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.id = id
builder.type = type
builder.opaque = opaque
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Offer) return false
if (unknownFields != other.unknownFields) return false
if (id != other.id) return false
if (type != other.type) return false
if (opaque != other.opaque) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (id?.hashCode() ?: 0)
result = result * 37 + (type?.hashCode() ?: 0)
result = result * 37 + (opaque?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (id != null) result += """id=$id"""
if (type != null) result += """type=$type"""
if (opaque != null) result += """opaque=$opaque"""
return result.joinToString(prefix = "Offer{", separator = ", ", postfix = "}")
}
public fun copy(
id: Long? = this.id,
type: Type? = this.type,
opaque: ByteString? = this.opaque,
unknownFields: ByteString = this.unknownFields,
): Offer = Offer(id, type, opaque, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var id: Long? = null
@JvmField
public var type: Type? = null
@JvmField
public var opaque: ByteString? = null
public fun id(id: Long?): Builder {
this.id = id
return this
}
public fun type(type: Type?): Builder {
this.type = type
return this
}
public fun opaque(opaque: ByteString?): Builder {
this.opaque = opaque
return this
}
public override fun build(): Offer = Offer(
id = id,
type = type,
opaque = opaque,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Offer::class,
"type.googleapis.com/signalservice.CallMessage.Offer",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: Offer): Int {
var size = value.unknownFields.size
size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.id)
size += Type.ADAPTER.encodedSizeWithTag(3, value.type)
size += ProtoAdapter.BYTES.encodedSizeWithTag(4, value.opaque)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Offer): Unit {
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
Type.ADAPTER.encodeWithTag(writer, 3, value.type)
ProtoAdapter.BYTES.encodeWithTag(writer, 4, value.opaque)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Offer): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.BYTES.encodeWithTag(writer, 4, value.opaque)
Type.ADAPTER.encodeWithTag(writer, 3, value.type)
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
}
public override fun decode(reader: ProtoReader): Offer {
var id: Long? = null
var type: Type? = null
var opaque: ByteString? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> id = ProtoAdapter.UINT64.decode(reader)
3 -> try {
type = Type.ADAPTER.decode(reader)
} catch (e: ProtoAdapter.EnumConstantNotFoundException) {
reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
}
4 -> opaque = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return Offer(
id = id,
type = type,
opaque = opaque,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Offer): Offer = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
public enum class Type(
public override val `value`: Int,
) : WireEnum {
OFFER_AUDIO_CALL(0),
OFFER_VIDEO_CALL(1),
;
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : EnumAdapter(
Type::class,
PROTO_2,
Type.OFFER_AUDIO_CALL
) {
public override fun fromValue(`value`: Int): Type? = Type.fromValue(value)
}
@JvmStatic
public fun fromValue(`value`: Int): Type? = when (value) {
0 -> OFFER_AUDIO_CALL
1 -> OFFER_VIDEO_CALL
else -> null
}
}
}
}
public class Answer(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#UINT64",
)
@JvmField
public val id: Long? = null,
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val opaque: ByteString? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.id = id
builder.opaque = opaque
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Answer) return false
if (unknownFields != other.unknownFields) return false
if (id != other.id) return false
if (opaque != other.opaque) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (id?.hashCode() ?: 0)
result = result * 37 + (opaque?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (id != null) result += """id=$id"""
if (opaque != null) result += """opaque=$opaque"""
return result.joinToString(prefix = "Answer{", separator = ", ", postfix = "}")
}
public fun copy(
id: Long? = this.id,
opaque: ByteString? = this.opaque,
unknownFields: ByteString = this.unknownFields,
): Answer = Answer(id, opaque, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var id: Long? = null
@JvmField
public var opaque: ByteString? = null
public fun id(id: Long?): Builder {
this.id = id
return this
}
public fun opaque(opaque: ByteString?): Builder {
this.opaque = opaque
return this
}
public override fun build(): Answer = Answer(
id = id,
opaque = opaque,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Answer::class,
"type.googleapis.com/signalservice.CallMessage.Answer",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: Answer): Int {
var size = value.unknownFields.size
size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.id)
size += ProtoAdapter.BYTES.encodedSizeWithTag(3, value.opaque)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Answer): Unit {
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.opaque)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Answer): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.BYTES.encodeWithTag(writer, 3, value.opaque)
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
}
public override fun decode(reader: ProtoReader): Answer {
var id: Long? = null
var opaque: ByteString? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> id = ProtoAdapter.UINT64.decode(reader)
3 -> opaque = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return Answer(
id = id,
opaque = opaque,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Answer): Answer = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}
public class IceUpdate(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#UINT64",
)
@JvmField
public val id: Long? = null,
@field:WireField(
tag = 5,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
)
@JvmField
public val opaque: ByteString? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.id = id
builder.opaque = opaque
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is IceUpdate) return false
if (unknownFields != other.unknownFields) return false
if (id != other.id) return false
if (opaque != other.opaque) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (id?.hashCode() ?: 0)
result = result * 37 + (opaque?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (id != null) result += """id=$id"""
if (opaque != null) result += """opaque=$opaque"""
return result.joinToString(prefix = "IceUpdate{", separator = ", ", postfix = "}")
}
public fun copy(
id: Long? = this.id,
opaque: ByteString? = this.opaque,
unknownFields: ByteString = this.unknownFields,
): IceUpdate = IceUpdate(id, opaque, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var id: Long? = null
@JvmField
public var opaque: ByteString? = null
public fun id(id: Long?): Builder {
this.id = id
return this
}
public fun opaque(opaque: ByteString?): Builder {
this.opaque = opaque
return this
}
public override fun build(): IceUpdate = IceUpdate(
id = id,
opaque = opaque,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
IceUpdate::class,
"type.googleapis.com/signalservice.CallMessage.IceUpdate",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: IceUpdate): Int {
var size = value.unknownFields.size
size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.id)
size += ProtoAdapter.BYTES.encodedSizeWithTag(5, value.opaque)
return size
}
public override fun encode(writer: ProtoWriter, `value`: IceUpdate): Unit {
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
ProtoAdapter.BYTES.encodeWithTag(writer, 5, value.opaque)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: IceUpdate): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.BYTES.encodeWithTag(writer, 5, value.opaque)
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
}
public override fun decode(reader: ProtoReader): IceUpdate {
var id: Long? = null
var opaque: ByteString? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> id = ProtoAdapter.UINT64.decode(reader)
5 -> opaque = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return IceUpdate(
id = id,
opaque = opaque,
unknownFields = unknownFields
)
}
public override fun redact(`value`: IceUpdate): IceUpdate = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}
public class Busy(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#UINT64",
)
@JvmField
public val id: Long? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.id = id
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Busy) return false
if (unknownFields != other.unknownFields) return false
if (id != other.id) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (id?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (id != null) result += """id=$id"""
return result.joinToString(prefix = "Busy{", separator = ", ", postfix = "}")
}
public fun copy(id: Long? = this.id, unknownFields: ByteString = this.unknownFields): Busy =
Busy(id, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var id: Long? = null
public fun id(id: Long?): Builder {
this.id = id
return this
}
public override fun build(): Busy = Busy(
id = id,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Busy::class,
"type.googleapis.com/signalservice.CallMessage.Busy",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: Busy): Int {
var size = value.unknownFields.size
size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.id)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Busy): Unit {
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Busy): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
}
public override fun decode(reader: ProtoReader): Busy {
var id: Long? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> id = ProtoAdapter.UINT64.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return Busy(
id = id,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Busy): Busy = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}
public class Hangup(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#UINT64",
)
@JvmField
public val id: Long? = null,
@field:WireField(
tag = 2,
adapter =
"org.whispersystems.signalservice.internal.push.CallMessage${'$'}Hangup${'$'}Type#ADAPTER",
)
@JvmField
public val type: Type? = null,
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#UINT32",
)
@JvmField
public val deviceId: Int? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.id = id
builder.type = type
builder.deviceId = deviceId
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Hangup) return false
if (unknownFields != other.unknownFields) return false
if (id != other.id) return false
if (type != other.type) return false
if (deviceId != other.deviceId) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (id?.hashCode() ?: 0)
result = result * 37 + (type?.hashCode() ?: 0)
result = result * 37 + (deviceId?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (id != null) result += """id=$id"""
if (type != null) result += """type=$type"""
if (deviceId != null) result += """deviceId=$deviceId"""
return result.joinToString(prefix = "Hangup{", separator = ", ", postfix = "}")
}
public fun copy(
id: Long? = this.id,
type: Type? = this.type,
deviceId: Int? = this.deviceId,
unknownFields: ByteString = this.unknownFields,
): Hangup = Hangup(id, type, deviceId, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var id: Long? = null
@JvmField
public var type: Type? = null
@JvmField
public var deviceId: Int? = null
public fun id(id: Long?): Builder {
this.id = id
return this
}
public fun type(type: Type?): Builder {
this.type = type
return this
}
public fun deviceId(deviceId: Int?): Builder {
this.deviceId = deviceId
return this
}
public override fun build(): Hangup = Hangup(
id = id,
type = type,
deviceId = deviceId,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Hangup::class,
"type.googleapis.com/signalservice.CallMessage.Hangup",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: Hangup): Int {
var size = value.unknownFields.size
size += ProtoAdapter.UINT64.encodedSizeWithTag(1, value.id)
size += Type.ADAPTER.encodedSizeWithTag(2, value.type)
size += ProtoAdapter.UINT32.encodedSizeWithTag(3, value.deviceId)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Hangup): Unit {
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
Type.ADAPTER.encodeWithTag(writer, 2, value.type)
ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.deviceId)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Hangup): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.UINT32.encodeWithTag(writer, 3, value.deviceId)
Type.ADAPTER.encodeWithTag(writer, 2, value.type)
ProtoAdapter.UINT64.encodeWithTag(writer, 1, value.id)
}
public override fun decode(reader: ProtoReader): Hangup {
var id: Long? = null
var type: Type? = null
var deviceId: Int? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> id = ProtoAdapter.UINT64.decode(reader)
2 -> try {
type = Type.ADAPTER.decode(reader)
} catch (e: ProtoAdapter.EnumConstantNotFoundException) {
reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
}
3 -> deviceId = ProtoAdapter.UINT32.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return Hangup(
id = id,
type = type,
deviceId = deviceId,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Hangup): Hangup = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
public enum class Type(
public override val `value`: Int,
) : WireEnum {
HANGUP_NORMAL(0),
HANGUP_ACCEPTED(1),
HANGUP_DECLINED(2),
HANGUP_BUSY(3),
HANGUP_NEED_PERMISSION(4),
;
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : EnumAdapter(
Type::class,
PROTO_2,
Type.HANGUP_NORMAL
) {
public override fun fromValue(`value`: Int): Type? = Type.fromValue(value)
}
@JvmStatic
public fun fromValue(`value`: Int): Type? = when (value) {
0 -> HANGUP_NORMAL
1 -> HANGUP_ACCEPTED
2 -> HANGUP_DECLINED
3 -> HANGUP_BUSY
4 -> HANGUP_NEED_PERMISSION
else -> null
}
}
}
}
public class Opaque(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
declaredName = "data",
)
@JvmField
public val data_: ByteString? = null,
@field:WireField(
tag = 2,
adapter =
"org.whispersystems.signalservice.internal.push.CallMessage${'$'}Opaque${'$'}Urgency#ADAPTER",
)
@JvmField
public val urgency: Urgency? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
public override fun newBuilder(): Builder {
val builder = Builder()
builder.data_ = data_
builder.urgency = urgency
builder.addUnknownFields(unknownFields)
return builder
}
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Opaque) return false
if (unknownFields != other.unknownFields) return false
if (data_ != other.data_) return false
if (urgency != other.urgency) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (data_?.hashCode() ?: 0)
result = result * 37 + (urgency?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (data_ != null) result += """data_=$data_"""
if (urgency != null) result += """urgency=$urgency"""
return result.joinToString(prefix = "Opaque{", separator = ", ", postfix = "}")
}
public fun copy(
data_: ByteString? = this.data_,
urgency: Urgency? = this.urgency,
unknownFields: ByteString = this.unknownFields,
): Opaque = Opaque(data_, urgency, unknownFields)
public class Builder : Message.Builder() {
@JvmField
public var data_: ByteString? = null
@JvmField
public var urgency: Urgency? = null
public fun data_(data_: ByteString?): Builder {
this.data_ = data_
return this
}
public fun urgency(urgency: Urgency?): Builder {
this.urgency = urgency
return this
}
public override fun build(): Opaque = Opaque(
data_ = data_,
urgency = urgency,
unknownFields = buildUnknownFields()
)
}
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Opaque::class,
"type.googleapis.com/signalservice.CallMessage.Opaque",
PROTO_2,
null,
"SignalService.proto"
) {
public override fun encodedSize(`value`: Opaque): Int {
var size = value.unknownFields.size
size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.data_)
size += Urgency.ADAPTER.encodedSizeWithTag(2, value.urgency)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Opaque): Unit {
ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.data_)
Urgency.ADAPTER.encodeWithTag(writer, 2, value.urgency)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Opaque): Unit {
writer.writeBytes(value.unknownFields)
Urgency.ADAPTER.encodeWithTag(writer, 2, value.urgency)
ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.data_)
}
public override fun decode(reader: ProtoReader): Opaque {
var data_: ByteString? = null
var urgency: Urgency? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> data_ = ProtoAdapter.BYTES.decode(reader)
2 -> try {
urgency = Urgency.ADAPTER.decode(reader)
} catch (e: ProtoAdapter.EnumConstantNotFoundException) {
reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
}
else -> reader.readUnknownField(tag)
}
}
return Opaque(
data_ = data_,
urgency = urgency,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Opaque): Opaque = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
public enum class Urgency(
public override val `value`: Int,
) : WireEnum {
DROPPABLE(0),
HANDLE_IMMEDIATELY(1),
;
public companion object {
@JvmField
public val ADAPTER: ProtoAdapter = object : EnumAdapter(
Urgency::class,
PROTO_2,
Urgency.DROPPABLE
) {
public override fun fromValue(`value`: Int): Urgency? = Urgency.fromValue(value)
}
@JvmStatic
public fun fromValue(`value`: Int): Urgency? = when (value) {
0 -> DROPPABLE
1 -> HANDLE_IMMEDIATELY
else -> null
}
}
}
}
}