commonMain.socket.preset.PollsPermissionUpdate.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-entities Show documentation
Show all versions of proto-entities Show documentation
KMP package which exports compiled protobuf entities to be used by other repos
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: socket.preset.PollsPermissionUpdate in socket/preset.proto
package socket.preset
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.AssertionError
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.DeprecationLevel
import kotlin.Int
import kotlin.Long
import kotlin.Nothing
import kotlin.String
import kotlin.Unit
import okio.ByteString
public class PollsPermissionUpdate(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#BOOL",
jsonName = "canCreate",
)
public val can_create: Boolean? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#BOOL",
jsonName = "canVote",
)
public val can_vote: Boolean? = null,
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#BOOL",
jsonName = "canView",
)
public val can_view: Boolean? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
@Deprecated(
message = "Shouldn't be used in Kotlin",
level = DeprecationLevel.HIDDEN,
)
public override fun newBuilder(): Nothing = throw
AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin")
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is PollsPermissionUpdate) return false
if (unknownFields != other.unknownFields) return false
if (can_create != other.can_create) return false
if (can_vote != other.can_vote) return false
if (can_view != other.can_view) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (can_create?.hashCode() ?: 0)
result = result * 37 + (can_vote?.hashCode() ?: 0)
result = result * 37 + (can_view?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (can_create != null) result += """can_create=$can_create"""
if (can_vote != null) result += """can_vote=$can_vote"""
if (can_view != null) result += """can_view=$can_view"""
return result.joinToString(prefix = "PollsPermissionUpdate{", separator = ", ", postfix = "}")
}
public fun copy(
can_create: Boolean? = this.can_create,
can_vote: Boolean? = this.can_vote,
can_view: Boolean? = this.can_view,
unknownFields: ByteString = this.unknownFields,
): PollsPermissionUpdate = PollsPermissionUpdate(can_create, can_vote, can_view, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object :
ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
PollsPermissionUpdate::class,
"type.googleapis.com/socket.preset.PollsPermissionUpdate",
PROTO_3,
null,
"socket/preset.proto"
) {
public override fun encodedSize(`value`: PollsPermissionUpdate): Int {
var size = value.unknownFields.size
size += ProtoAdapter.BOOL.encodedSizeWithTag(1, value.can_create)
size += ProtoAdapter.BOOL.encodedSizeWithTag(2, value.can_vote)
size += ProtoAdapter.BOOL.encodedSizeWithTag(3, value.can_view)
return size
}
public override fun encode(writer: ProtoWriter, `value`: PollsPermissionUpdate): Unit {
ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.can_create)
ProtoAdapter.BOOL.encodeWithTag(writer, 2, value.can_vote)
ProtoAdapter.BOOL.encodeWithTag(writer, 3, value.can_view)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: PollsPermissionUpdate): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.BOOL.encodeWithTag(writer, 3, value.can_view)
ProtoAdapter.BOOL.encodeWithTag(writer, 2, value.can_vote)
ProtoAdapter.BOOL.encodeWithTag(writer, 1, value.can_create)
}
public override fun decode(reader: ProtoReader): PollsPermissionUpdate {
var can_create: Boolean? = null
var can_vote: Boolean? = null
var can_view: Boolean? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> can_create = ProtoAdapter.BOOL.decode(reader)
2 -> can_vote = ProtoAdapter.BOOL.decode(reader)
3 -> can_view = ProtoAdapter.BOOL.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return PollsPermissionUpdate(
can_create = can_create,
can_vote = can_vote,
can_view = can_view,
unknownFields = unknownFields
)
}
public override fun redact(`value`: PollsPermissionUpdate): PollsPermissionUpdate =
value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}