commonMain.socket.preset.ChatPermissionUpdate.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.ChatPermissionUpdate 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 ChatPermissionUpdate(
@field:WireField(
tag = 1,
adapter = "socket.preset.PublicChatPermission#ADAPTER",
declaredName = "public",
)
public val public_: PublicChatPermission? = null,
@field:WireField(
tag = 2,
adapter = "socket.preset.PrivateChatPermission#ADAPTER",
declaredName = "private",
)
public val private_: PrivateChatPermission? = 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 ChatPermissionUpdate) return false
if (unknownFields != other.unknownFields) return false
if (public_ != other.public_) return false
if (private_ != other.private_) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (public_?.hashCode() ?: 0)
result = result * 37 + (private_?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (public_ != null) result += """public_=$public_"""
if (private_ != null) result += """private_=$private_"""
return result.joinToString(prefix = "ChatPermissionUpdate{", separator = ", ", postfix = "}")
}
public fun copy(
public_: PublicChatPermission? = this.public_,
private_: PrivateChatPermission? = this.private_,
unknownFields: ByteString = this.unknownFields,
): ChatPermissionUpdate = ChatPermissionUpdate(public_, private_, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object :
ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
ChatPermissionUpdate::class,
"type.googleapis.com/socket.preset.ChatPermissionUpdate",
PROTO_3,
null,
"socket/preset.proto"
) {
public override fun encodedSize(`value`: ChatPermissionUpdate): Int {
var size = value.unknownFields.size
size += PublicChatPermission.ADAPTER.encodedSizeWithTag(1, value.public_)
size += PrivateChatPermission.ADAPTER.encodedSizeWithTag(2, value.private_)
return size
}
public override fun encode(writer: ProtoWriter, `value`: ChatPermissionUpdate): Unit {
PublicChatPermission.ADAPTER.encodeWithTag(writer, 1, value.public_)
PrivateChatPermission.ADAPTER.encodeWithTag(writer, 2, value.private_)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: ChatPermissionUpdate): Unit {
writer.writeBytes(value.unknownFields)
PrivateChatPermission.ADAPTER.encodeWithTag(writer, 2, value.private_)
PublicChatPermission.ADAPTER.encodeWithTag(writer, 1, value.public_)
}
public override fun decode(reader: ProtoReader): ChatPermissionUpdate {
var public_: PublicChatPermission? = null
var private_: PrivateChatPermission? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> public_ = PublicChatPermission.ADAPTER.decode(reader)
2 -> private_ = PrivateChatPermission.ADAPTER.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return ChatPermissionUpdate(
public_ = public_,
private_ = private_,
unknownFields = unknownFields
)
}
public override fun redact(`value`: ChatPermissionUpdate): ChatPermissionUpdate = value.copy(
public_ = value.public_?.let(PublicChatPermission.ADAPTER::redact),
private_ = value.private_?.let(PrivateChatPermission.ADAPTER::redact),
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}