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