commonMain.socket.plugin.PluginStoreItem.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.plugin.PluginStoreItem in socket/plugin.proto
package socket.plugin
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 com.squareup.wire.`internal`.sanitize
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
/**
* Response sent whenever a plugin store is updated.
* Applicable for all requests that access a store.
*/
public class PluginStoreItem(
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
)
public val timestamp: String = "",
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "peerId",
)
public val peer_id: String = "",
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "storeKey",
)
public val store_key: String = "",
@field:WireField(
tag = 4,
adapter = "com.squareup.wire.ProtoAdapter#BYTES",
label = WireField.Label.OMIT_IDENTITY,
)
public val payload: ByteString = ByteString.EMPTY,
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 PluginStoreItem) return false
if (unknownFields != other.unknownFields) return false
if (timestamp != other.timestamp) return false
if (peer_id != other.peer_id) return false
if (store_key != other.store_key) return false
if (payload != other.payload) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + timestamp.hashCode()
result = result * 37 + peer_id.hashCode()
result = result * 37 + store_key.hashCode()
result = result * 37 + payload.hashCode()
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
result += """timestamp=${sanitize(timestamp)}"""
result += """peer_id=${sanitize(peer_id)}"""
result += """store_key=${sanitize(store_key)}"""
result += """payload=$payload"""
return result.joinToString(prefix = "PluginStoreItem{", separator = ", ", postfix = "}")
}
public fun copy(
timestamp: String = this.timestamp,
peer_id: String = this.peer_id,
store_key: String = this.store_key,
payload: ByteString = this.payload,
unknownFields: ByteString = this.unknownFields,
): PluginStoreItem = PluginStoreItem(timestamp, peer_id, store_key, payload, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
PluginStoreItem::class,
"type.googleapis.com/socket.plugin.PluginStoreItem",
PROTO_3,
null,
"socket/plugin.proto"
) {
public override fun encodedSize(`value`: PluginStoreItem): Int {
var size = value.unknownFields.size
if (value.timestamp != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1,
value.timestamp)
if (value.peer_id != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.peer_id)
if (value.store_key != "") size += ProtoAdapter.STRING.encodedSizeWithTag(3,
value.store_key)
if (value.payload != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(4,
value.payload)
return size
}
public override fun encode(writer: ProtoWriter, `value`: PluginStoreItem): Unit {
if (value.timestamp != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.timestamp)
if (value.peer_id != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.peer_id)
if (value.store_key != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.store_key)
if (value.payload != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 4,
value.payload)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: PluginStoreItem): Unit {
writer.writeBytes(value.unknownFields)
if (value.payload != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 4,
value.payload)
if (value.store_key != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.store_key)
if (value.peer_id != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.peer_id)
if (value.timestamp != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.timestamp)
}
public override fun decode(reader: ProtoReader): PluginStoreItem {
var timestamp: String = ""
var peer_id: String = ""
var store_key: String = ""
var payload: ByteString = ByteString.EMPTY
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> timestamp = ProtoAdapter.STRING.decode(reader)
2 -> peer_id = ProtoAdapter.STRING.decode(reader)
3 -> store_key = ProtoAdapter.STRING.decode(reader)
4 -> payload = ProtoAdapter.BYTES.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return PluginStoreItem(
timestamp = timestamp,
peer_id = peer_id,
store_key = store_key,
payload = payload,
unknownFields = unknownFields
)
}
public override fun redact(`value`: PluginStoreItem): PluginStoreItem = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}