commonMain.hiveline.stream.AllocStreamRequest.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: hiveline.stream.AllocStreamRequest in hiveline/stream.proto
package hiveline.stream
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`.immutableCopyOf
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 kotlin.collections.List
import okio.ByteString
public class AllocStreamRequest(
@field:WireField(
tag = 1,
adapter = "hiveline.stream.Stream#ADAPTER",
label = WireField.Label.OMIT_IDENTITY,
)
public val stream: Stream? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#UINT32",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "streamId",
)
public val stream_id: Int = 0,
layers_ids: List = emptyList(),
@field:WireField(
tag = 4,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
)
public val endpoint: String? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#UINT32",
label = WireField.Label.PACKED,
jsonName = "layersIds",
)
public val layers_ids: List = immutableCopyOf("layers_ids", layers_ids)
@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 AllocStreamRequest) return false
if (unknownFields != other.unknownFields) return false
if (stream != other.stream) return false
if (stream_id != other.stream_id) return false
if (layers_ids != other.layers_ids) return false
if (endpoint != other.endpoint) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (stream?.hashCode() ?: 0)
result = result * 37 + stream_id.hashCode()
result = result * 37 + layers_ids.hashCode()
result = result * 37 + (endpoint?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (stream != null) result += """stream=$stream"""
result += """stream_id=$stream_id"""
if (layers_ids.isNotEmpty()) result += """layers_ids=$layers_ids"""
if (endpoint != null) result += """endpoint=${sanitize(endpoint)}"""
return result.joinToString(prefix = "AllocStreamRequest{", separator = ", ", postfix = "}")
}
public fun copy(
stream: Stream? = this.stream,
stream_id: Int = this.stream_id,
layers_ids: List = this.layers_ids,
endpoint: String? = this.endpoint,
unknownFields: ByteString = this.unknownFields,
): AllocStreamRequest = AllocStreamRequest(stream, stream_id, layers_ids, endpoint, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object :
ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
AllocStreamRequest::class,
"type.googleapis.com/hiveline.stream.AllocStreamRequest",
PROTO_3,
null,
"hiveline/stream.proto"
) {
public override fun encodedSize(`value`: AllocStreamRequest): Int {
var size = value.unknownFields.size
if (value.stream != null) size += Stream.ADAPTER.encodedSizeWithTag(1, value.stream)
if (value.stream_id != 0) size += ProtoAdapter.UINT32.encodedSizeWithTag(2, value.stream_id)
size += ProtoAdapter.UINT32.asPacked().encodedSizeWithTag(3, value.layers_ids)
size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.endpoint)
return size
}
public override fun encode(writer: ProtoWriter, `value`: AllocStreamRequest): Unit {
if (value.stream != null) Stream.ADAPTER.encodeWithTag(writer, 1, value.stream)
if (value.stream_id != 0) ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.stream_id)
ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 3, value.layers_ids)
ProtoAdapter.STRING.encodeWithTag(writer, 4, value.endpoint)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: AllocStreamRequest): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.STRING.encodeWithTag(writer, 4, value.endpoint)
ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 3, value.layers_ids)
if (value.stream_id != 0) ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.stream_id)
if (value.stream != null) Stream.ADAPTER.encodeWithTag(writer, 1, value.stream)
}
public override fun decode(reader: ProtoReader): AllocStreamRequest {
var stream: Stream? = null
var stream_id: Int = 0
var layers_ids: MutableList? = null
var endpoint: String? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> stream = Stream.ADAPTER.decode(reader)
2 -> stream_id = ProtoAdapter.UINT32.decode(reader)
3 -> {
if (layers_ids == null) {
val minimumByteSize = 1
val initialCapacity = (reader.nextFieldMinLengthInBytes() / minimumByteSize)
.coerceAtMost(Int.MAX_VALUE.toLong())
.toInt()
layers_ids = ArrayList(initialCapacity)
}
layers_ids!!.add(ProtoAdapter.UINT32.decode(reader))
}
4 -> endpoint = ProtoAdapter.STRING.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return AllocStreamRequest(
stream = stream,
stream_id = stream_id,
layers_ids = layers_ids ?: listOf(),
endpoint = endpoint,
unknownFields = unknownFields
)
}
public override fun redact(`value`: AllocStreamRequest): AllocStreamRequest = value.copy(
stream = value.stream?.let(Stream.ADAPTER::redact),
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}