commonMain.media.SessionDescription.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: media.SessionDescription in media/common.proto
package media
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
public class SessionDescription(
@field:WireField(
tag = 1,
adapter = "media.Target#ADAPTER",
label = WireField.Label.OMIT_IDENTITY,
)
public val target: Target = Target.PUBLISHER,
/**
* 'offer' | 'answer'
*/
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
)
public val type: String = "",
/**
* sdp contents
*/
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
)
public val sdp: String = "",
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 SessionDescription) return false
if (unknownFields != other.unknownFields) return false
if (target != other.target) return false
if (type != other.type) return false
if (sdp != other.sdp) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + target.hashCode()
result = result * 37 + type.hashCode()
result = result * 37 + sdp.hashCode()
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
result += """target=$target"""
result += """type=${sanitize(type)}"""
result += """sdp=${sanitize(sdp)}"""
return result.joinToString(prefix = "SessionDescription{", separator = ", ", postfix = "}")
}
public fun copy(
target: Target = this.target,
type: String = this.type,
sdp: String = this.sdp,
unknownFields: ByteString = this.unknownFields,
): SessionDescription = SessionDescription(target, type, sdp, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object :
ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
SessionDescription::class,
"type.googleapis.com/media.SessionDescription",
PROTO_3,
null,
"media/common.proto"
) {
public override fun encodedSize(`value`: SessionDescription): Int {
var size = value.unknownFields.size
if (value.target != Target.PUBLISHER) size += Target.ADAPTER.encodedSizeWithTag(1,
value.target)
if (value.type != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.type)
if (value.sdp != "") size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.sdp)
return size
}
public override fun encode(writer: ProtoWriter, `value`: SessionDescription): Unit {
if (value.target != Target.PUBLISHER) Target.ADAPTER.encodeWithTag(writer, 1, value.target)
if (value.type != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.type)
if (value.sdp != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.sdp)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: SessionDescription): Unit {
writer.writeBytes(value.unknownFields)
if (value.sdp != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.sdp)
if (value.type != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.type)
if (value.target != Target.PUBLISHER) Target.ADAPTER.encodeWithTag(writer, 1, value.target)
}
public override fun decode(reader: ProtoReader): SessionDescription {
var target: Target = Target.PUBLISHER
var type: String = ""
var sdp: String = ""
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> try {
target = Target.ADAPTER.decode(reader)
} catch (e: ProtoAdapter.EnumConstantNotFoundException) {
reader.addUnknownField(tag, FieldEncoding.VARINT, e.value.toLong())
}
2 -> type = ProtoAdapter.STRING.decode(reader)
3 -> sdp = ProtoAdapter.STRING.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return SessionDescription(
target = target,
type = type,
sdp = sdp,
unknownFields = unknownFields
)
}
public override fun redact(`value`: SessionDescription): SessionDescription = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}